Matlab will not recognize Arduino commands even after installing hardware support packages
Show older comments
I have installed the two Matlab/Simulink Arduino support packages shown in the image below, but even so, Matlab doesn't seem to recognize the Arduino commands.

a=arduino() works for setting up the connection, but for some reason Matlab won't take a=arduino('COM5', 'Uno'), telling me I have too many input arguments. Similarly, Matlab does not recognize the function readVoltage(a, 'A0'). Images of the errors are attached. (In the first image, the arduino setup line is commented out, but obviously it was not when being tested)


Any suggestions would be much appreciated.
3 Comments
Madhu Govindarajan
on 23 Nov 2015
Can you check if the appropriate arduino function is on MATLAB's path using
>> which -all arduino
For reference, I got the following when I executed that command and hopefully you do too. If not that is the cause of error, and reinstalling might fix it.
C:\MATLAB\SupportPackages\R2015a\arduinoio\toolbox\matlab\hardware\supportpackages\arduinoio\arduino.m % arduino constructor C:\Program Files\MATLAB\R2015a\toolbox\matlab\hardware\stubs\arduino.m % Shadowed
Fatima Kishimoto
on 24 Feb 2019
I was getting this exact same error and i tried what you asked and it gives these same paths relative to my installation.What to do next?I even tried changing the shadowed file name but the error still isnt fixed.
Madhu Govindarajan
on 25 Feb 2019
Hi Fatima,
Depends on which version of MATLAB you are using. Is it possible in your version to do arduinosetup?
Type this command in MATLAB and see if you can program the board using that workflow. If this command does not exist please share MATLAB version details.
Regards,
Madhu
Answers (0)
Categories
Find more on Arduino Hardware in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!