フィルターのクリア

plot of markers, having different color in one line of code.

1 回表示 (過去 30 日間)
mikkel stær
mikkel stær 2021 年 3 月 14 日
回答済み: ANKUR KUMAR 2021 年 3 月 15 日
hi why can i not do the following. when it follows the rules from the "plot" command sytax
i want one line and write plot one time, with all the information inside.
since i already know that i could just write them seperately.
plot(x2,y2,".",'MarkerFaceColor',[0.500 0.3250 0.0500], "Markersize",20,x3,y3,".",'MarkerFaceColor',[0.8500 0.3250 0.0980], "Markersize",20)
or
plot(x2,y2,".",'MarkerFaceColor',[0.500 0.3250 0.0500],x3,y3,".",'MarkerFaceColor',[0.8500 0.3250 0.0980], "Markersize",20)
is there a way to nest with () or [] or {} pls help.

採用された回答

ANKUR KUMAR
ANKUR KUMAR 2021 年 3 月 15 日
x2=[1,3];
y2=[3,4];
x3=[3,4,5];
y3=[1,6,7];
cell_values={x2,y2;x3,y3};
col_vals={[0.500 0.3250 0.0500],[0.8500 0.3250 0.0980]};
for kk=1:size(cell_values,1)
plot(cell_values{kk,1},cell_values{kk,2},'kd','MarkerFaceColor',col_vals{kk})
hold on
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by