Getting better pdf and histogram

3 ビュー (過去 30 日間)
Nathaniel Porter
Nathaniel Porter 2022 年 2 月 24 日
回答済み: Pratyush Swain 2023 年 11 月 27 日
load InsulinReadings.mat
xX2 = InsulinReadings;
xX2(xX2==0)=missing;
A2 = mean(xX2,'all',"omitnan")
B2 = median(xX2,'all',"omitnan")
C2 = max(xX2,[],'all',"omitnan")
D2 = min(xX2,[],'all', "omitnan")
histogram(xX2)
[D PD] = allfitdist(xX2,'PDF');
xlabel('Insulin');
%Now get the CDF
[D PD] = allfitdist(xX2,'CDF');
xlabel('Insulin')
  1 件のコメント
Image Analyst
Image Analyst 2022 年 2 月 24 日
I think you posted before you added the question.

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

回答 (1 件)

Pratyush Swain
Pratyush Swain 2023 年 11 月 27 日
Hi Nathaniel,
I understand you want to obtain a better pdf and histogram for your data. Please refer to https://www.mathworks.com/matlabcentral/answers/593578-calculating-pdf-from-data-set regarding how to obtain pdf from a dataset.
You can also try adjusting histogram properties like 'binwidth','numbins' to obtain a better histogram. For more information,please refer to https://www.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.histogram.html
Hope this helps.

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by