Pages: [1]   Go Down
Author Topic: Help with first Arduino and Matlab collaboration  (Read 1070 times)
0 Members and 1 Guest are viewing this topic.
Wrexham, North Wales
Offline Offline
Full Member
***
Karma: 0
Posts: 143
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I have been following a tutorial on you tube on how to get your Arduino board recognized within MatLab.  First I created 2 GUI buttons "ON" and "OFF" in order to switch pin 13's LED on and off.  When I try and compile/run the .m file called "buttons" I keep getting all these errors:

Undefined function 'arduino' for input arguments of type 'char'.

Error in buttons>buttons_OpeningFcn (line 66)
a = arduino('COM3');

Error in gui_mainfcn (line 221)
    feval(gui_State.gui_OpeningFcn, gui_hFigure, [],
    guidata(gui_hFigure), varargin{:});

Error in buttons (line 42)
    gui_mainfcn(gui_State, varargin{:});


I am working with an Arduino UNO R3, Windows 7 and MatLab 2012a.  I have tried putting everything within the MATLAB path within "documents" but still the same errors.  I also looked under ports and seen that my UNO is on "COM3".  But it says the function "arduino" is undefined.

The link for the video is here:



Any help would be much appreciated.
« Last Edit: January 14, 2013, 12:01:19 pm by daz1761 » Logged

M

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 224
Posts: 13917
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

please post the whole code, only an error message is so difficult for us...
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Wrexham, North Wales
Offline Offline
Full Member
***
Karma: 0
Posts: 143
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

please post the whole code, only an error message is so difficult for us...

Thanks for the reply.  It turned out that my ArduinoIO folder within my MATLAB folder was not on my MatLab path. I've now put the ArduinoIO folder on my path and moved my "buttons.fig" and "buttons.m" files within the folder and its working fine.  And its working fine in the command window.
Logged

M

Pages: [1]   Go Up
Jump to: