Signal pattern classification - To plot multi-colored 2D plots
이전 댓글 표시
Hi,
I am new to matlab, and i was trying signal processing. And i was trying to classify a certain signal based on certain range of values which indicated different states. Now to represent this classification i wanted to plot this vector with different colors at different states. But somehow, the entire plot changes color for -
x=sinewave;
for i=1:length(sinewave)
if x(i)>=0
plot(x,'r');
drawnow;
hold on;
else
plot(x,'b');
drawnow;
hold on;
end
refreshdata;
end
or the x axis of the plot changes for -
x=sinewave;
for i=1:length(sinewave)
if x(i)>=0
plot(x(i),'r');
drawnow;
hold on;
else
plot(x(i),'b');
drawnow;
hold on;
end
refreshdata;
end
I'd be grateful if anyone can kindly let me know if there is nay better way of doing this or if there is something that i am missing?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Scatter Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!