Do not continually close and open the serial port.
The default for serial ports is to read asynchronously. You have to change the serial port properties to read synchronously.
You have not changed your serial port terminator character, as is needed for arduino. See the MATLAB File Exchange contribution that shows a GUI for interacting with arduino devices.
Best Answer