Date: Jan 23, 2013 11:19 AM
Author: Phil
Subject: Increment figure number in 3 dimensional loop

Hi,

I have a 3 dimensional loop (as per the code below). However, when I plot the first 8 figures of the 1st "k" loop, the 8 figures plotted with the second "k" loop overwrite the original 8 figures from the 1st "k" loop.

How can I increment the figures so that 16 are shown i.e. 8 from the 1st "k" loop and 8 from the 2nd "k" loop?

Thanks,

Phil

for k = 1:2;
for j = 1:8;
figure(j);
contourf(x,y,z{:,j,k}));
end
end