How to control the Arduino with MATLAB in realtime


i want read data arduino matlab , send result matlab arduino in realtime. how it?
i know now:
in matlab:
s= serial('com3', 'baudrate', 9600, 'parity', 'none', 'databits', 8);
fopen(s)
z=fscanf(s)
(caculate in matlab)
fscantf(s, '1'); (send result arduino)

in arduino

serial.print('to send matlab');

1.i try read data arduino in matlab, "warning:a timeout occurred before terminator reached." how solve it?
2.how use arduino read data matlab?

arduino read data   <-----------------------------------------------  
            |                                                                             |
            |                                                                             |
            v                                                                             |
matlab read data arduino , calculate               |
            |                                                                             |
            |                                                                             |
            v                                                                             |
arduino read information matlab , something---


thanks

quote
2.how use arduino read data matlab?

on arduino, use serial.begin() in setup() start using serial port.

to read data sent matlab, use serial.available() see how data available, , serial.read() read data 1 byte @ time.

quote
1.i try read data arduino in matlab, "warning:a timeout occurred before terminator reached." how solve it?

we'd need see sketch being used send data serial port, , matlab code trying read data.



Arduino Forum > Forum 2005-2010 (read only) > Software > Interfacing > How to control the Arduino with MATLAB in realtime


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums