MATLAB: Can I not connect the bluetooth device with ‘serialport’

bluetoothInstrument Control Toolboxserialserialport

I am using a NeuroSky MindWave device connected via bluetooth. When reading data from a serial port device, the old 'serial' function together with read works. The new 'serialport' together with read does not.
Note that the device is getting connected in both cases (as shown by the blinking of the diode at the device).
Here is what I am doing:
%%this code works
s=serial('/dev/tty.MindWaveMobile-DevA');
fopen(s);
data=fread(s,1,'char')
fclose(s);
%%this does not work and returns with a timeout
s=serialport('/dev/tty.MindWaveMobile-DevA',9600);
data=read(s,1,'char')
delete(s);
In the second case, the 'read' function returns with:
Warning: The specified amount of data was not returned within the Timeout period for 'read'.
'serialport' unable to read any data. For more information on possible reasons, see serialport Read Warnings.
Looking at the 'serial' object after 'fopen' shows that there are bytes available for reading.
Looking at the 'serialport' object after initializing shows zero bytes available for reading.
For now I can use serial, but since it's recommended to transition to 'serialport', I'd be glad for any hints.

Best Answer

This is likely due to multiple processes attempting to use the same serial port. Restarting the PC has resolved this issue.