Send values in a variable from Matlab to arduino using serial communications

2 ビュー (過去 30 日間)
David Lee
David Lee 2019 年 4 月 17 日
Dear all, may I know how to send a values (numbers) in a variables from MATLAB to ARDUINO.
Below is my coding but error arise.
%Compute Standard Deviation of x and send it to serial
sdA = std(x)
s = serial('COM6');
s.Baudrate = 9600;
s.Terminator = 'CR';
%open serial port
fopen(s);
%send value '100' else send 101
fprintf(s,'sdA');
fscanf(s);
fclose(s);

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Support Package for Arduino Hardware についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by