Skip to content

Instantly share code, notes, and snippets.

View chassall's full-sized avatar

Cameron Hassall chassall

View GitHub Profile
fclose(u); % close the UDP connection
@chassall
chassall / remarker.m
Created May 5, 2017 23:19
Modify a BrainVision EEG marker file.
% Open the old marker file
filename = 'oldFile.vmrk';
fileId = fopen(filename);
% Open a new marker file for writing
newFilename = 'newFile.vmrk';
newFileId = fopen(newFilename,'w');
% Get a line from the old file
thisLine = fgets(fileId);
oscsend(u,'/muse/elements/marker','i',1); % Send marker 1 on UDP connection u
@chassall
chassall / openconnection.m
Last active April 28, 2017 18:36
Opens a UDP connection for sending markers to a MuseLab recording.
u = udp('localhost',5555); % specify the UDP address that markers will be sent to
fopen(u); % open the UDP connection