matlab-connect-bluetooth-low-energy-device

Discover, connect to, and exchange data with BLE peripheral devices from MATLAB.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-connect-bluetooth-low-energy-device
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-connect-bluetooth-low-energy-device
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/test-and-measurement/matlab-connect-bluetooth-low-energy-device
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-connect-bluetooth-low-energy-device

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Connecting to Bluetooth Low Energy devices in MATLAB involves subtle pitfalls: connected devices stop advertising, characteristic access requires paired service and characteristic UUIDs, and exclusive connections cause confusing "Access denied" errors. This Skill guides the agent through the correct discovery, connection, and data-exchange workflow without guesswork.

Core Features & Use Cases

  • Filtered Device Discovery: Scan for BLE peripherals by name or advertised service UUID using blelist, with handling for empty results and existing workspace connections.
  • Characteristic Access and I/O: Read, write, and subscribe to GATT characteristics using the correct two-UUID characteristic() signature, including notification callbacks with DataAvailableFcn.
  • Data Logging: Log notification streams to tab-separated text files using the bundled bleDataCollector.m script instead of lossy polling loops.
  • Use Case: A user wants to monitor heart rate from a wearable sensor. The Skill scans for the device advertising service 180D, connects after user confirmation, subscribes to characteristic 2A37, and streams readings into MATLAB.

Quick Start

Scan for my BLE heart rate sensor, connect to it, and subscribe to its heart rate measurement notifications.

Frequently Asked Questions about matlab-connect-bluetooth-low-energy-device

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect to a BLE device from MATLAB?

Scan for devices with blelist, optionally filtering by name or service UUID, then connect using ble("DeviceName") or ble(address). Once connected, access characteristics with characteristic(b, serviceUUID, characteristicUUID) and use read, write, or subscribe.

How do I read and write BLE characteristics in MATLAB?

First create a characteristic object with characteristic(b, serviceUUID, characteristicUUID), then call read(c) or write(c, data). Read and write operate on characteristic objects, not on the ble connection object directly.

Does MATLAB BLE require the Bluetooth Toolbox?

No. BLE functions such as blelist, ble, characteristic, read, write, and subscribe are built into MATLAB itself and require no additional toolbox. The Bluetooth Toolbox is not needed for BLE peripheral connections.

Why does blelist not find my BLE device?

A connected BLE device stops advertising, so check the workspace for an existing connected ble object first. Also confirm the device is powered on, in advertising mode, within range, and not already connected to another application or MATLAB session.

Why do I get "Access denied" when accessing a BLE service?

BLE connections are exclusive, so another MATLAB session or application likely holds the connection to the same device. Disconnect from the other session with clear or by closing it, then reconnect from the current session.

How do I log BLE sensor data over time in MATLAB?

Subscribe to the characteristic and set a DataAvailableFcn callback that calls read(src, "oldest") to consume buffered notifications in order. Avoid polling with read in a loop, which misses data between reads.