I have a code for data acquisition n plotting from one sensor how do write the code for three sensors such that I plot three graphs of different color in same figure
이전 댓글 표시
clear all
close all
clc;
a = arduino();
tmax = 50;
figure(1),
grid on,
title('pulse sensor Analog Voltage Real Time Data Graph')
xlabel ('Time (s)'), ylabel('Voltage');
axis([0 tmax+1 -0.5 5.5]);
k = 0;
v = 0;
t = 0;
tic
while toc<= tmax
k = k + 1;
v(k) = readVoltage(a,'A0');
t(k) = toc;
if k > 1
line([t(k-1) t(k)],[v(k-1) v(k)]);
drawnow;
end
end
댓글 수: 3
Amit Kadarmandalgi
2018년 12월 25일
anil simsek
2020년 5월 6일
I have Arduino code, I want to draw it instantly in matlab. Can you help me
Walter Roberson
2020년 5월 7일
The frameworks people have posted should work, provided that you do not need more than about 40 Hz. (But I do recommend animatedline() instead of continually doing line())
채택된 답변
추가 답변 (2개)
Walter Roberson
2018년 12월 25일
0 개 추천
line() can accept a 'color' option.
However, it is inefficient to draw a line between every pair of points. You should look at animatedline() which permits you to addpoints()
카테고리
도움말 센터 및 File Exchange에서 MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!