Dao - how and where in your GUI have you initialized s? Based on the error message and the fact that s is declared as a global variable, it probably has not been initialized properly and so is empty. For example, the following code generates the same error message
s = [];
fgets(s);
Find the code where you initialize s and make sure that you specify that s is global. Something like
function opensSerialPort()
global s;
s = fopen(...);
Now try the re-running your GUI to see what happens.
---------------
As an aside, you may want to experiment with the input obj to your BytesAvailable_Callback. As obj is the serial port object that caused the event to occur, then you may be able to just do
function BytesAvailable_Callback(obj,event)
myData = fgets(obj);
I haven't tested this out, but it may be worth trying because it would simplify the code (and avoid troublesome global variables).