Pages: [1]   Go Down
Author Topic: Problem on matlab interfacing  (Read 193 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 .
Logged

Scotland
Offline Offline
Edison Member
*
Karma: 26
Posts: 1325
Have you had your Arduino fix today?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please refer to the matlab forum, it's covered in great length there.
Logged

Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Please refer to the matlab forum, it's covered in great length there.
I could not find the solution. Kindly help me
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My MATLAB is not able to use that function either. A solution is to use serial:

Code:
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:

Code:
set(a,'Baudrate',9600); % Set BaudRate to 9600.

Then you have to open the serial connection, using fopen:

Code:
fopen(a);

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:

Code:
fclose(a);

Do not forget to use fclose, else you cannot use that serial port by any other application unless you restart MATLAB.
Logged

Scotland
Offline Offline
Edison Member
*
Karma: 26
Posts: 1325
Have you had your Arduino fix today?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

https://www.youtube.com/watch?v=RAkw-lnaZR0   <-- found on GOOGLE
Logged

Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

Pages: [1]   Go Up
Jump to: