how to create random marker indices in a loop?

10 ビュー (過去 30 日間)
Barry Allen
Barry Allen 2020 年 4 月 20 日
コメント済み: Holden Tranquillo 2023 年 10 月 30 日
I want to plot different marker indices , i have written the code in for loop and the plot function comes under the loop.So I need to create different marker for the plots in the same figure.
for i=2:6
xxxx;
YYYY;
plot(x,y,'Marker','?')
hold
end
what should i change in the question mark area to obtain a different markers

採用された回答

Mehmed Saad
Mehmed Saad 2020 年 4 月 20 日
figure,hold on
x = 1:10;
all_marks = {'o','+','*','.','x','s','d','^','v','>','<','p','h'};
for i=1:6
y = rand(1,10);
plot(x,y,'LineStyle','none','Marker',all_marks{mod(i,13)})
end
  1 件のコメント
Holden Tranquillo
Holden Tranquillo 2023 年 10 月 30 日
This works well until i = 13 and then mod(13,13) is 0 :-)

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

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by