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!

 Risposta accettata

Adam Danz
Adam Danz il 9 Feb 2019
Modificato: Adam Danz il 9 Feb 2019
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

Più risposte (0)

Categorie

Scopri di più su Debugging and Improving Code in Centro assistenza e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by