How create moving plot in MATLAB grader (in moodle)
古いコメントを表示
I want students to create a moving plot like:
t = linspace(1,10,10);
for i=1:10;
pause(0.2);
x = i./t;
plot(x)
end
But in grader they can only see the last plot.
採用された回答
その他の回答 (1 件)
Anirban Mandal
2022 年 4 月 6 日
編集済み: Anirban Mandal
2022 年 4 月 6 日
You can use the following code for generating all the 10 plots. Let me know if this the solution you are looking for.
t = linspace(1,10,10);
for i=1:10;
pause(0.2);
x = i./t;
figure(i)
plot(x)
end
2 件のコメント
adam soker
2022 年 4 月 6 日
Anirban Mandal
2022 年 4 月 6 日
Then you can use the comet function for a moving plot.
t = linspace(1,10,10);
for i=1:10;
pause(0.2);
x = i./t;
comet(x)
end
カテゴリ
ヘルプ センター および File Exchange で Univariate Discrete Distributions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!