How to plot the diffusion curve for different timesteps?
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (1)
Torsten
el 3 de Dic. de 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.
Categorías
Más información sobre Annotations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!