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!