cd('C:/Users/ppmaes/Desktop/EEG/MATLAB/')
version -java
javaaddpath('javaosctomatlab.jar');
import com.illposed.osc.*;
import java.lang.String
receiver =  OSCPortIn(4000);
osc_method = String('/ECG');
osc_listener = MatlabOSCListener();
receiver.addListener(osc_method,osc_listener);
receiver.startListening();
while(1)
    struct = osc_listener.getMessageArgumentsAsDouble();
     if ~isempty(struct) == 1
         struct
     end
end

receiver.stopListening();
receiver=0;


