histogram2から数値テーブルを作成したい

조회 수: 3 (최근 30일)
和也
和也 2022년 8월 2일
편집: Hiro Yoshino 2022년 8월 2일
histogram2は2変量頻度分布図に作成されますが、この図から数値テーブルを作成したいと思います。
ヒストグラムからは全体的なデータの分布を把握し、加工用としてテーブルの値をピックアップして利用したいためです。
詳しい方ご回答よろしくお願いします。

답변 (1개)

Hiro Yoshino
Hiro Yoshino 2022년 8월 2일
편집: Hiro Yoshino 2022년 8월 2일
histcount2 を使うと良いかと思います。以下の N でテーブル(行列) を得られます。
https://jp.mathworks.com/help/matlab/ref/histcounts2.html
x = randn(100,1);
y = randn(100,1);
[N,Xedges,Yedges] = histcounts2(x,y)
N = 7×6
0 1 0 0 0 0 0 4 9 4 0 0 0 3 10 9 4 0 1 3 9 13 10 1 0 6 1 7 1 0 0 0 3 0 0 0 0 0 0 0 1 0
Xedges = 1×8
-3 -2 -1 0 1 2 3 4
Yedges = 1×7
-3 -2 -1 0 1 2 3
histogram2(x,y,Xedges,Yedges)

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!