How to plot the diffusion curve for different timesteps?
Show older comments
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
Accepted Answer
More Answers (1)
Torsten
on 3 Dec 2022
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.
Categories
Find more on Fit Postprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!