creating a loop for pcolor values
Show older comments
i have an x and y matrix that are each 547x599 and a z matrix that has a time step (547x599x193). how do i make a loop that will plot each matrix for each of the 193 time steps using pcolor? (also using the pause command so it pauses before each plot)
Answers (2)
Image Analyst
on 4 Nov 2018
Is this what you want?
for k = 1 : size(z, 3)
pcolor(z(:,:,k));
drawnow;
pause(0.3);
end
1 Comment
joshua bromberg
on 4 Nov 2018
joshua bromberg
on 4 Nov 2018
0 votes
6 Comments
Walter Roberson
on 4 Nov 2018
Use zzb{i} instead of, zzb(i)
joshua bromberg
on 5 Nov 2018
Image Analyst
on 5 Nov 2018
You didn't do what he said - to use braces. You just used parentheses again. Looks like you really need to read the FAQ: https://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F
Alternatively you can just use zb(:,:,i) like I showed in my answer. This extracts and shows just one slice/plane of the zb volumetric image.
joshua bromberg
on 5 Nov 2018
joshua bromberg
on 5 Nov 2018
Walter Roberson
on 5 Nov 2018
zzb{i}=zb(:,:,i);
Categories
Find more on Creating and Concatenating Matrices 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!