I've a matrix of 0's and 1's. It is changing with time. I'm using imshow to visualize the matrix. However, I want to see how the data changes with time. Now I can see only the final state. If I run it 1000 times, I want to all of that happening one after the other.
Thanks!

 Respuesta aceptada

Adam Danz
Adam Danz el 9 de Feb. de 2019
Editada: Adam Danz el 9 de Feb. de 2019

1 voto

The solution depends on how the matrix is being updated but here's a general framework to updating a time varying matrix using imshow().
while ~done
% <--- update matrix here
imshow()
drawnow
pause(0.2) %seconds
if isdone %determine if you're on the last frame (replace 'isdone')
done = true
end
end

Más respuestas (0)

Categorías

Más información sobre Debugging and Improving Code en Centro de ayuda y File Exchange.

Preguntada:

el 9 de Feb. de 2019

Editada:

el 9 de Feb. de 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by