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!

 Akzeptierte Antwort

Adam Danz
Adam Danz am 9 Feb. 2019
Bearbeitet: Adam Danz am 9 Feb. 2019

1 Stimme

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

Weitere Antworten (0)

Kategorien

Mehr zu Debugging and Improving Code finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by