loading
Picture of Arduino I/O-Matlab basic tutorial
arduino.jpg
this is my very first instructables and I was referred by an old member. Follow her link here: (http://www.instructables.com/member/Analogue-Chick/

Its a simple illustration on how we can connect Arduino to Matlab and actually control and get information on Arduino
using Matlab

I have seen few tutorials regarding how to control or get data from Arduino using Matlab. Matlab is a very powerful tool for student and engineers a like. That's why i want to create this tutorial as a start for those, like me want to explore the 2 powerful tools in engineering and techs.

It's a rough start for me since this is my first post in instructables.... feel free to comment so i can improve it thanks!

here's the vid for the demo:
http://youtu.be/R50R5ZK_URE

Step 1: Step 1: Things you need to know

In this tutorial you need to know the following:
1. Matlab and creating M-file and GUI (there are tons of tutorials online)
        http://www.youtube.com/watch?v=D_hmws6dwgg
        http://www.youtube.com/watch?v=TIqa98quARE
        http://www.youtube.com/watch?v=qAGiAq6HhYQ
2. Arduino and Arduino programming
        http://arduino.cc/en/Guide/HomePage
3. Arduino Support with Matlab
        http://www.mathworks.com/academia/arduino-software/arduino-matlab.html
        tutorials from Giampiero Campa
        http://www.mathworks.com/matlabcentral/fileexchange/27843-arduino-io-package-slides-and-examples

 
محمدق3 months ago

Please can you show code of matlab GUI

fansblink3 months ago

Very good tutorial, but I've tried many times, always just an error message like this below, can you help me? please

Error in gui_mainfcn (line 95)
feval (varargin {:});

Error in yes (line 16)
gui_mainfcn (gui_State, varargin {:});

Error in @ (hObject, eventdata) yes ('pbOn_Callback', hObject, eventdata, guidata (hObject))

DevendraD3 months ago

How can I connect BCILAB 1.1 output from MATLAB 2013b to arduino and then using it cntrolling servomotor? The picture depicted is dynamic graphical output of MATLAB .I want to use it control the servo motor.

bci .jpgbci 2.jpg
jaykhade22335 months ago

how can we use serial commands in matlab to transmit data from tx and rx pin of arduino?

rmagtibay (author)  jaykhade22335 months ago

1. try to get the com port of your arduino

2. access the communication by accessing >>a = serial('COM1') -->> this is an example

3. then to open the communication >>fopen(a)

to access data (receive data) from the arduino >>fscanf(a)

4. to send data (transmit data) to the arduino >> fprintf(a,'your value here')

rmagtibay (author) 9 months ago

Hi, sorry for may late reply. you can download the codes here. the codes are:

yes.fig.txt

yes.m.txt

just change the filename and remove the .txt extenstion

Can you pass me the code please? my email is alejandro.leon1894@gmail.com

Good!where is the code ?

rmagtibay (author)  ahluoxiao20101 year ago

the yes.m.txt and yes.fig.tx if the file. download it and change the filename to:

yes.m

yes.fig

put it on documents\matlab folder

great! can you borrow me the program code please?

i cant download the files

rmagtibay (author) 1 year ago

try to change the txt file that you download here

Thanks bro!

in my project i've building a Matlab GUI plotting real time data from arduino. But when I try to read two or more analog ports at the same time theres a error messege about the COM port. Do you know how I fix it?

rmagtibay (author)  Alan Souza1 year ago

can you send the codes ill try to look at it. thanks!

Send me your email for I send you the codes. Thank you

Alan Souza1 year ago

Great Job!!

I'm making a project that i'm using the arduino and matlab.

Can you send me the m.file and figure?

Thanks

Welcome to Instructables! :D
rmagtibay (author)  Analogue-Chick3 years ago
Thanks ma aiz
cool, great idea!