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!