Subplots coming out in multiple figures

4 次查看(过去 30 天)
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!

采纳的回答

Matt J
Matt J 2019-2-4
编辑:Matt J 2019-2-4
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
  5 个评论
Maria Y
Maria Y 2019-2-4
Got it. The variable itc_freq_mean should loop through the 6 conditions (itc_condition) based on this for loop I wrote earlier:
for nfreq = 1:6
itc_freq_mean(nfreq, :) = circ_mean(squeeze(itc_condition(freq_ind{nfreq}, time_ind, :)));
end
Should I add it somewhere in the m-loop?
Matt J
Matt J 2019-2-5
Only compute k-dependent things in the k-loop.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Spectral Measurements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by