フィルターのクリア

How to make 3 stem plots in a loop of 40 iterations

1 回表示 (過去 30 日間)
John Agkali
John Agkali 2014 年 11 月 10 日
回答済み: Star Strider 2014 年 11 月 10 日
hello, I have 3 variables that need to be plotted through stem function (Path_length,diam,average_degree). So I wrote these lines in MatLab
for i=1:40
%calculations here for each one of the total 40 patients
hold on;
grid on;
axis square;
if (i>16)
stem(i,Path_length,'r','filled');
else
stem(i,Path_length,'filled');
end
hold off;
hold on;
grid on;
axis square;
if (i>16)
stem(i,diam,'r','filled');
else
stem(i,diam,'filled');
end
hold off;
hold on;
grid on;
axis square;
if (i>16)
stem(i,average_degree,'r','filled');
else
stem(i,average_degree,'filled');
end
hold off;
end
But I get this instead:
Is there anyway I can make three different figures for each different variable? And how can I make this? thank you!

回答 (1 件)

Star Strider
Star Strider 2014 年 11 月 10 日
I’m not certain what you’re doing, but perhaps the stem3 function is what you want.

カテゴリ

Help Center および File ExchangeStem Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by