Save histogram graphs during for loop operation

16 ビュー (過去 30 日間)
Turbulence Analysis
Turbulence Analysis 2022 年 2 月 7 日
コメント済み: Mia 2023 年 10 月 19 日
Hi,
I got my data stored in the form of 100 x 192, I am generating one histrogram plot per 8 columns of data. This means, finally 24 histogram plots. May I know, how to save one histogram plot for every 8 iteration!!!
for i = 1:1:192
BB = Data (:,i);
histogram(BB);
hold on
end

採用された回答

Ankit
Ankit 2022 年 2 月 7 日
n = 1;
for i = 8:8:192
Data = rand(100,192);
BB = Data (:,n:i); n = i;
f=figure;
histogram(BB);
saveas(f, ['histogram' num2str(i/8) '.png'])
hold on
end
exportgraphics in case you are using above 2020
% Requires R2020a or later
exportgraphics(f,['histogram' num2str(i/8) '.png'],'Resolution',300)
  4 件のコメント
Turbulence Analysis
Turbulence Analysis 2022 年 2 月 7 日
Thanks a lot.. This is perfect !!!
Mia
Mia 2023 年 10 月 19 日
Thank you!!!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by