plotting multiple histograms from data saved as double

1 回表示 (過去 30 日間)
Steffi
Steffi 2020 年 4 月 3 日
コメント済み: Ameer Hamza 2020 年 4 月 3 日
hey guys..
I am trying to get 30 subplots with each 3 (differently coloured) histograms from column 1:3 of each row of the attached dataset saved as double.
tried hist but this wouldnt let me change the colour....histogram didnt work with double/cell array i think.
I am new to matlab...anyone could help? using matlab 2019b.
thanks!

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 3 日
編集済み: Ameer Hamza 2020 年 4 月 3 日
There are 29 rows in the cell array you attached.
colors = [1 0 0;
0 1 0;
0 0 1];
fig = figure();
ax = gobjects(1, 30);
for i = 1:size(P_RTpertrial,1)
ax(i) = subplot(10,3,i);
hold(ax(i));
for j = 1:size(M, 2)
histogram(P_RTpertrial{i,j}, 'FaceColor', colors(j,:), 'FaceAlpha', 0.3);
end
end
fig.WindowState = 'maximized';
  10 件のコメント
Steffi
Steffi 2020 年 4 月 3 日
just downloaded new matlab version including toolbox and it works perfectly well now!
thanks a million!
Ameer Hamza
Ameer Hamza 2020 年 4 月 3 日
Glad to be of help.

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

その他の回答 (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