More MATLAB Trouble

Do you think this is better.
I am thinking of changing the whole thing to this algorithm
send firstValue , SecondValue;ThirdValue: /n

read serial
switch inByte
case ,
firstValue = atof(arraychar);
reset (arraychar);

case ';' :
secondValue = atof(arraychar);
reset value;

case ':' :
thirdValue = atof(arrayChar);

default:
inData[pos++] += inByte;