フィルターのクリア

To find histogram of two variables

3 ビュー (過去 30 日間)
SP
SP 2022 年 7 月 13 日
コメント済み: KSSV 2022 年 7 月 13 日
Hi,
I need to find Histogram properties of two variable x and y and to store it in a separate cell array a. I have used below code but, I am getting only the histogram properties of y, Kindly help me with this. Thanks in advance.
x = rand(1000,1);
y = rand(1500,1);
a = histogram(x);
b = histogram(y);
c = {a;b};

採用された回答

KSSV
KSSV 2022 年 7 月 13 日
x = rand(1000,1);
y = rand(1500,1);
[N{1},edges{1}] = histcounts(x);
[N{2},edges{2}] = histcounts(y);
  1 件のコメント
KSSV
KSSV 2022 年 7 月 13 日
x = rand(1000,1);
y = rand(1500,1);
figure(1)
h(1) = histogram(x);
figure(2)
h(2) = histogram(y);
h(1)
ans =
Histogram with properties: Data: [1000×1 double] Values: [97 93 90 107 118 86 113 103 91 102] NumBins: 10 BinEdges: [0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1] BinWidth: 0.1000 BinLimits: [0 1] Normalization: 'count' FaceColor: 'auto' EdgeColor: [0 0 0] Show all properties
h(2)
ans =
Histogram with properties: Data: [1500×1 double] Values: [154 167 150 139 161 157 116 163 140 153] NumBins: 10 BinEdges: [0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1] BinWidth: 0.1000 BinLimits: [0 1] Normalization: 'count' FaceColor: 'auto' EdgeColor: [0 0 0] Show all properties

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by