When I want to interface Arduino with matlab and I am writing the code in Matlab' a=arduino('COM15'); the error message showing "Undefined function 'arduino' for input arguments of type 'char'.". Kindly help me .
Please refer to the matlab forum, it’s covered in great length there.
I could not find the solution. Kindly help me
My MATLAB is not able to use that function either. A solution is to use serial:
a=serial('COM15'); % Start up serial port.
It reads out the COM port you defined, which means that you can read out any serial information. You can use "set" to change the properties of your serial data transfer:
set(a,'Baudrate',9600); % Set BaudRate to 9600.
Then you have to open the serial connection, using fopen:
You can use all functions like scanf and printf to read and write over the serial connection, and finally, you have to close the serial connection using fclose:
Do not forget to use fclose, else you cannot use that serial port by any other application unless you restart MATLAB.