Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • D Documentation
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • anywave
  • Documentation
  • Wiki
  • Write MATLAB plugin

Last edited by Bruno Colombet Jul 23, 2025
Page history
This is an old version of this page. You can view the most recent version or browse the history.

Write MATLAB plugin

  • Requirements
  • 1. Use the Plugin Creation Assistant
  • 1.1 desc.txt
  • 1.1.1 optional lines
  • 1.2 main.m
  • 2. Compiled plugin
  • 3. check that AnyWave detects your plugin at startup
  • IMPORTANT note about the init function
    • Make your plugin BIDS Pipeline compatible
    • DEBUG PLUGINS directly in MATLAB
    • MATLAB API functions

A MATLAB plugin is a folder located in the user home dir.
Documents\AnyWave\Plugins\MATLAB on Windows.
/home/username/AnyWave/Plugins/MATLAB on Linux.
/users/username/AnyWave/Plugins/MATLAB on MacOS.

Requirements

MATLAB.
AnyWave will detect the MATLAB installation when starting up.
However, if MATLAB was installed in a custom directory, it will be invisible to AnyWave. To fix that, you must use a user.json file that must be located in the Settings folder.
See section Customise MATLAB.

If you want to distribute your plugin, the best tool is the MATLAB compiler which generate a standalone application.
The target compute must have the matching version of the MATLAB Runtime in order to run it.
AnyWave will detect runtimes installed on the computer if they have been installed in the default folder of your system.

Use user.json file to change path where runtimes are located in order for AnyWave to find them.

1. Use the Plugin Creation Assistant

image

image

1.1 desc.txt

This file is a simple text file that must contain the following lines:
name = My Plugin
description = Do something on data

1.1.1 optional lines

To tune up the behavior of your plugin you may add some flags to tell AnyWave what you plugin can do:
flags=nodatarequired -> this line will inform anywave that your plugin can run even if no data file is open.
flags=canrunfromcommandline -> this flag indicates that your plugin can be run from the command line.
You can combine flags by separating them with a colon (:)
flags=nodatarequired:canrunfromcommandline

Put your plugin in a submenu, by adding the following line:
category=Process:MyCategory:My plugin
This line will create a sub menu called MyCategory in the Processes Menu of AnyWave and a link to launch the plugin.

1.2 main.m

This is a MATLAB function you can create within MATLAB.

function main(varargin)
args = anywave('init', varargin);
% args contains all the properties related to AnyWave current data file and the plugin context.
% my plugin code starts here

2. Compiled plugin

Using the MATLAB Compiler, you can create a standalone version of your plugin.
AnyWave can call the standalone version of your plugin if you add the following line in desc.txt:
compiled plugin=nameofexefile
Example for Delphos plugin, the desc.txt contains the line:
compiled plugin=delphos.exe
It is also strongly recommended to specify the version of the Runtime needed to run the plugin.
add a new line to desc.txt file:
runtime=version
For example with recent releases of MATLAB:
runtime=R2024b
You have to install the matching runtime version on your system.
AnyWave should detect it when starting up and when the time comes to run the plugin, it will setup the context to run the plugin with the required Runtime version.

3. check that AnyWave detects your plugin at startup

Close and relaunch AnyWave, your plugin should appear in the Processes menu.

IMPORTANT note about the init function

Before calling any anywave commands in your code, call the init function this way:

args = anywave('init', varargin);

Be sure that your main function accepts varargin (cell array) argument.

function main(varargin)

This will ensure that your plugin can be compiled and run by AnyWave as a standalone application.
The args variable is a structure/dictionnay that contains all useful properties you may use in your plugin.

The anywave application path, the current plugin directory, etc.

Make your plugin BIDS Pipeline compatible

DEBUG PLUGINS directly in MATLAB

MATLAB API functions

Clone repository
  • Build_AnyWave
  • CLI
  • CLI_List
  • Changes
  • ExportData
  • ICA
  • Imaginary Coherence
  • MATLAB anywave function
  • MATLAB_BIDS
  • MATLAB_change_sig_prop
  • MATLAB_debug
  • MATLAB_get_data
  • MATLAB_get_markers
  • MATLAB_get_props
  • MATLAB_init
View All Pages