Myo SDK MATLAB MEX Wrapper
Updated 28 Oct 2022
Thalmic Labs' Myo Gesture Control Armband (myo.com) features an Inertial Measurement Unit (IMU) and 8 surface Electromyography sensors (sEMG) in addition to a Windows SDK that allows developers to obtain access to this data!
Check out this Preview video on YouTube to see what this package can do,
On the surface, this package contains a simplified m-code class, MyoMex, that enables MATLAB users to stream data from one or two Myo devices at 50Hz (IMU and meta data) and 200Hz (EMG) with only 1 command! Note that EMG data is not available when using two devices due to hardware/software limitations.
mm = MyoMex(); % Upon construction, MyoMex starts accumulating streaming data in its myoData property
m = mm.myoData; % get MyoData object
% Data is now being pushed into log properties of m named,
% quat_log, gyro_log, accel_log, emg_log, etc.
% Data acquisition is non-blocking, too!
mm.delete(); % clean up
The IMU data includes estimated quaternion (orientation), three-axis gyroscope (angular velocity), and three-axis accelerometer (linear acceleration).
The sEMG data includes 8 raw data channels plus the output of Myo's built-in gesture detection.
Here are some of the things that you'll find in this package,
* README.txt - Step-by-step instructions for prerequisite configuration
* install_myo_mex() - installation tool
* build_myo_mex() - MEX-file build tool
* MyoMex_Quickstart - Quickstart guide script with example code and liberal comments
* MyoMexGUI_Monitor - GUI implementation of streaming data with visualization of all available data
New Simulink support includes MEX C/C++ S-Function block and other supporting utility blocks that support two following configurations:
* One Myo - EMG disabled
* One Myo - EMG enabled
* Two Myos - EMG disabled
The Simulink block data outputs mirror the data available from MyoData in m-code. The data is streamed in soft real-time. Thus, Simulink Desktop Real-Time is required to synchronize the model with the system clock.
This is being developed on one machine configuration: MATLAB R2013a; Windows 7 64-bit; VS2012 Pro
Comment and rate below! If you have questions, I answer messages pretty quickly.
You can also email me or send a message through my profile here,
mark (at) mark-toma (dot) com | marktoma (at) buffalo (dot) edu
I'll also stay current with the repo on GitHub,
There's a post about this package at Thalmic Labs' Developer Forums,
Mark Tomaszewski (2023). Myo SDK MATLAB MEX Wrapper (https://github.com/mark-toma/MyoMex), GitHub. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
- Simulink > Simulation >
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Versions that use the GitHub default branch cannot be downloaded
NEW support for Myo in Simulink! This is new and is not well tested. The current solution requires some sort of soft real time synchronization, hence the Simulink Desktop Real-Time requirement.
Fixes garbled code due to GitHub misuse. Otherwise same logic as v2.4.
Fixes a bunch of problems with using multiple Myos
This is the *real* v2.3!
added link to preview video on youtube
Disabled EMG when using two Myos (hardware/software limitations); Added newDataFcn callbacks to MyoMex and MyoData; Added example directory with one script for testing data for corruption.
Unchanged the title after GitHub transition
Some new features in MyoMex (no changes to myo_mex) and a slew of modifications to the example GUI. The myo_mex build has also been tested successfully with Visual Studio 2012 Professional.
Inserted two newlines this time.