MATLAB: Arduino Support Package Failing to Connect With any Arduino Mega

arduinoMATLAB

Hello,
I'm trying to use matlab to connect to an arduino Mega, but every time I try the connection fails. When I use arduinosetup I can hit program and it will say it programmed successfully, but when I try to test the connection it tells me to check the settings. When I use a = arduino('COM13','Mega2560','Trace',true), It tells me: "Internal error: The initialization of the server code is incorrect." I have tried it on atleast five other arduino megas and it's always the same result. Thank you.

Best Answer

For anyone with this same problem, the solution is to press the reset button right after you create the arduino object. It might be best to upload the server to the board first using arduinosetup, and then create the arduino object and right after you press enter hit the reset button.
Related Question