フィルターのクリア

savefig in loop leads to an empty figure

2 ビュー (過去 30 日間)
PAK
PAK 2018 年 9 月 7 日
編集済み: KSSV 2018 年 9 月 7 日
Hi All,
I'm trying to use savefig in a loop to save some polarhistograms as .fig files and for some reason it saves it properly but when I open the .fig files, it is empty. Any help would be much appreciated. Interestingly, using file--> saveas in the figure window doesn't work either.
for ii = 1:S(1)
for jj = 1:S(2)
tmp = bandphase(ii,:);
C{ii,jj} = tmp(Bandphase_logical(jj,:));
phases_nonan{ii,jj} = ~isnan(C{ii,jj});
phases{ii,jj} = C{ii,jj}(phases_nonan{ii,jj});
if all(isempty(phases{ii,jj}))
continue
else
polarhistograms{ii,jj} = polarhistogram(phases{ii,jj},19);
savefig(gcf,sprintf('NS6_001_NS3_001_recalled_cluster_%d_band_%d_phaselock.fig',ii,jj));
[pval{ii,jj}, z{ii,jj}] = circ_rtest(phases{ii,jj});
[mu{ii,jj}, ul{ii,jj}, ll{ii,jj}] = circ_mean(phases{ii,jj}');
end
end
end
Thanks!
PAK
  2 件のコメント
Image Analyst
Image Analyst 2018 年 9 月 7 日
Help us to help you. Attach a .mat file with S, bandphase, and Bandphase_logical in it. http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer
PAK
PAK 2018 年 9 月 7 日
編集済み: KSSV 2018 年 9 月 7 日
Hi,
Thank you! I've attached a link to the file.
Please let me know if I can provide anything else. I really appreciate the quick response!
PAK

サインインしてコメントする。

回答 (1 件)

KSSV
KSSV 2018 年 9 月 7 日
編集済み: KSSV 2018 年 9 月 7 日
The difference between max and min bin edges should be less then 2*pi. Try
polarhistograms{ii,jj} = polarhistogram(abs(phases{ii,jj}),19);
The above might not be what you seeking. But accordingly, I think you need to change your phases values.

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by