How to identify the type of the Histogram distribution?

Hi All,
I have medical images,I've plotted it's histograms,now I need to identify the type of these histograms(e.g. One may be like Gaussian distribution, Normal distribution.etce...),is there a builtin Matlab function for * identify the type of Histogram distribution * or any code does that? my goal: I have two algorithms for image segmentation,so if the distribution was Gaussian type I will use the first algorithms else use the second algorithm,please any could guide me to do this job.thank in advance for time and support

Risposte (1)

You can use kstest() if you have the Statistics Toolbox:
x = 10+randn(1000,1);
test_cdf = makedist('normal','mu',10,'sigma',1);
[h,p] = kstest(x,'cdf',test_cdf);

7 Commenti

Thank you Mr. Wayne King,but I am not wish to make a specific type of distribution,I want to know what is the type of the distribution?,please guide me,thanks in advance.
In your original that this question duplicates, you asked specifically for Gaussian (== "normal") distribution. kstest() does that test.
If you want to know the name of the distribution then you can use the File Exchange contribution linked to in your original question that this question duplicates. If your distribution does not fit within any one of the ones known to that tool, then you can attempt to extend that tool.
There is no Mathworks supplied tool to name distributions of arbitrary data, and there cannot be such a tool, as there are an infinite number of possible distributions. The Curve Fitting Toolbox goes part way towards a more generalized solution, but the generalized solution also needs to include time delay and feedback networks where later samples might be correlated with earlier samples.
Thank you very much,and I am sorry for duplication the question(I'm stuck and I need help urgently),please how can I use kstest()?should I use specify the distribution name and this function will tell me that is type or not?please guide me I am new in Matlab.thanks in advance.
please could you explain what do mean by x?in this code :
x = 10+randn(1000,1);
test_cdf = makedist('normal','mu',10,'sigma',1);
[h,p] = kstest(x,'cdf',test_cdf);
I wrote the following code should I have h=1 if the two distributions are fit approximately?
x = 10+randn(1000,1);
test_cdf = makedist('normal','mu',10,'sigma',1);
Image1 = imread('d:\roi.bmp');
[x1,counts1] = imhist(Image1(:,:,1),2);
stem(counts1,x1);
[h,p] = kstest(counts1,'cdf',test_cdf);
Please response to me I am waiting...
hope ur doing well hamed

Accedi per commentare.

Richiesto:

il 16 Gen 2014

Commentato:

il 20 Nov 2022

Community Treasure Hunt

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

Start Hunting!

Translated by