MATLAB: Subplots coming out in multiple figures

subplots

I'm trying to create 6 plots with 6 subplots within each. Right now when I run it, it's coming out as 37 individual plots – any idea on where I'm going wrong?
f1=figure;
rose(itc_freq_mean(nfreq,:));
for m=1:6
for k=1:6
h=figure;
hold on
subplot(2,3,k);
itc_freq_plot=(itc_freq_mean(k,:));
rose(itc_freq_mean(k,:));
title(freq_titles{k});
end
end
Thank you in advance!

Best Answer

Invoke figure() in the outer loop only,
for m=1:6
figure;
for k=1:6
subplot(2,3,k);
itc_freq_plot=(itc_freq_mean(k,:));
rose(itc_freq_mean(k,:));
title(freq_titles{k});
end
end