Can you change individual elements in a for loop each time?
2 ビュー (過去 30 日間)
古いコメントを表示
Is it possible to change something non-numerical inside a for loop each time it goes through? I'm trying to make a different colored line on a graph every time it loops. If that's not possible, I'd love to know what else I could do to achieve the result.
To have some code to tweak I suppose it could be something like the following, but I'm trying to have each value of 'x' as represented on the graph a different color (first loop (1,5) a black circle, second (2,5) a red one, third (3,5) a blue, etc).
clc;clear;close all
figure
hold on
for x=1:10
y=5;
plot(x,y,'ko')
end
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graphics Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

