How to plot the diffusion curve for different timesteps?
古いコメントを表示
I would like to plot the diffusion curve produced in the for loop at different time steps, for example every 500 timesteps. I would like these all plotted on the same graph. What is the best way to do this? I have been plotting plot(C_new) for the final curve.
This is my for loop:
for t = 1:n_timesteps
function
end
採用された回答
その他の回答 (1 件)
Torsten
2022 年 12 月 3 日
Save C in the loop for the values of t where you want to plot the curves. You should get a matrix like C(ntimes,nx).
Then outside the loop plot C as
plot(x,C)
where x is the 1 x nx row vector of spatial coordinates where the diffusion curve is computed.
カテゴリ
ヘルプ センター および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!