3-axis plot realtime error

Hi,
The task is to get data from 3axis sensor (gyroscope) and plot it in realtime. I can easily plot one value but when comes to 3 rises the problem..
my code is the following
function serialread(zaxis)
y=zeros(1,1000);
s=serial('COM3');
fopen(s);
counterz=1;
while counterz<=zaxis
ylim([-500 500]);
data=fscanf(s, '%d %d %d', 1);
plot(counterz,data);
drawnow
counterz=counterz+1;
end
fclose(s);
delete(s);
clear all;
end
The data i'm getting from my serial connection (is arduino) it comes to a format like this;
324 52 -255
24 -124 35
.. ..
Any suggestions?
Thank you in advance

2 件のコメント

ChristianW
ChristianW 2013 年 2 月 26 日
Why closed?
Minas
Minas 2013 年 2 月 26 日
Indeed...

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeWeather and Atmospheric Science についてさらに検索

質問済み:

2013 年 2 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by