I have a double loop where I wish to also return a subplot:
for j = 1:tileno
for k = 1:tileno
imsub{j,k} = imgquant(rowdiv*(j-1)+1:rowdiv*j, coldiv*(k-1)+1:coldiv*k);
subplot(tileno, tileno, ???); hist(imsub{j,k}(:), n_bins);
end
end
So the code stores some rowdiv*coldiv images in imsub{j,k} and during that loop I wish to plot a histogram of each of these stored images. I tried running a loop over that double loop:
for j = 1:tileno
for k = 1:tileno
for p = 1:tileno^2
imsub{j,k} = imgquant(rowdiv*(j-1)+1:rowdiv*j, coldiv*(k-1)+1:coldiv*k);
subplot(tileno, tileno, p); hist(imsub{j,k}(:), n_bins);
end
end
end
but this returned the same histogram tileno^2 times, so I think it does a histogram of imsub{1,1} for instance and then subplots this for each p, rather than for each p returning a distinct hist(imsub{j,k}). Many thanks for any help.