필터 지우기
필터 지우기

Normalize y axis in Matlab histogram2 Percentage

조회 수: 2 (최근 30일)
Megan
Megan 2019년 12월 4일
편집: Megan 2020년 2월 19일
Hi guys,
i have a histogram (histogram2)
on the z axis there is the frequency (how many)
But I dont want so see 15000 or something like that. I Want to see Percentage 0-100%

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 12월 4일
This example gives you the hints, just divide the y with total elements
ran_data=randi(15,[1 150]); % Just random data
[result_per bin]=hist(ran_data);
bar(result_per/150); % divide by total elements, here array size 150

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by