![](https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/037b7bac-c3fb-4641-bb31-e7f247e4f6a4/b6b962ca-5970-4ac2-ae54-ce2f02353f84/images/screenshot.png)
Finding fitgmdist value range from histogram
4 ビュー (過去 30 日間)
古いコメントを表示
Hello Altruists,
I have some data in 'rawdata.mat'
I want find the intensity distribution of the rawdata. For example, if we take the histogram of:
H = histogram(J);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/284009/image.png)
Looks like there are 2/3 Gaussian models. I want to take the one with maximum mean. But how do I find the range of values under that Gaussian distribution. For example the max Gaussian mean is at 234.
How do I choose the range of the Gaussian distribution?
GMModel = fitgmdist(double(J),2);
0 件のコメント
回答 (1 件)
Image Analyst
2020 年 4 月 13 日
See my File Exchange submission where you can fit the data to any number of Gaussians:
![](https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/037b7bac-c3fb-4641-bb31-e7f247e4f6a4/b6b962ca-5970-4ac2-ae54-ce2f02353f84/images/screenshot.png)
7 件のコメント
Image Analyst
2020 年 4 月 15 日
You're getting some sort of error. It's not being displayed because it seems some helper functions are not included. I'm including them here.
Image Analyst
2020 年 4 月 15 日
Your data does not fit 3 or even 4 Gaussians well at all. Anyway, I'm attaching the code, test1.m, that works for 4 Gaussians and you can see that there is not a good fit for just Pure Gaussians.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/284829/image.png)
There seems to be a ramp. You might try using fitnlm() and add in the ramp. I'm attaching a demo for fitnlm.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/284830/image.png)
Adapt it to fit 3 Gaussians.
参考
カテゴリ
Help Center および File Exchange で Statistics and Machine Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!