Express data in percentage

조회 수: 1 (최근 30일)
Kofial
Kofial 2020년 7월 17일
댓글: Kofial 2020년 7월 17일
Hi everyone.
I need some help with smth that looks easy but I can't solve it.
I need to convert and express the y axis (LWP) in %
This is the code:
decsending_LWP 32x16x60 double
ascending_LWP 32x16x60 double
edges 1x45 double
h1 1x44 double
h2 1x44 double
lat 16x1 double
lon 32x1 double
time 32x16x60 int64
edges = [-0.1:0.025:1];
h1 = histcounts(ascending_LWP,edges);
h2 = histcounts(descending_LWP,edges);
figure
bar(edges(1:end-1),[h1; h2]')
grid on
xlabel('LWP bin');
ylabel('LWP');
Many thanks
  댓글 수: 1
Kofial
Kofial 2020년 7월 17일
I did like that but was not sure what normalization does :)

댓글을 달려면 로그인하십시오.

채택된 답변

Arthur Roué
Arthur Roué 2020년 7월 17일
[h1, edges1] = histcounts(ascending_LWP, 'Normalization', 'probability');
[h2, edges1] = histcounts(descending_LWP, 'Normalization', 'probability');
From MATLAB doc : specify 'Normalization' as 'probability' to normalize the bin counts so that sum(N) is 1. That is, each bin count represents the probability that an observation falls within that bin.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Exploration and Visualization에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by