Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: gmdistribution.fit ERROR: Method 'fit' is not defined for class 'gmdistribution' or is removed from MATLAB's search path
Replies: 1   Last Post: Jul 9, 2013 11:02 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 17,945
Registered: 12/7/04
Re: gmdistribution.fit ERROR: Method 'fit' is not defined for class 'gmdistribution' or is removed from MATLAB's search path
Posted: Jul 9, 2013 11:02 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Fabio " <fabioscky-@libero.it> wrote in message
> Hi, I have to use a specific program that contains those rows:

>>S = struct('mu',mu,'Sigma',sigma,'PComponents',p);
>>options = statset('Display','final','MaxIter', 9000);
>>object =gmdistribution.fit(X,NGauss,'Options', options,'Start',S);

> but when I launch the program it returns this error:

>>Error using gmdistribution.fit
>>Method 'fit' is not defined for class 'gmdistribution' or is removed from
>>MATLAB's search path.

Which version of MATLAB and Statistics Toolbox are you using?

What do you see when you type:

which -all gmdistribution

which -all fit

I want to make sure that there's no other gmdistribution class that's taking
precedence over the one included in Statistics Toolbox.

>>Error in val (line 149)
>>object =gmdistribution.fit(X,NGauss,'Options', options,'Start',S);

> Into the folder "toolbox/stats/stas" there is the "@gmdistribution"
> directory, but if I try to create a new path it returns:

>>you cannot add method folders(ones that starts with '@'). or private
>>folders to your Matlab search path.

> Moreover if i type "gmdistribution" on the command window it returns:

>>> gmdistribution
> ans =
> gmdistribution
> Properties:
> NDimensions: 0
> DistName: 'gaussian mixture distribution'
> NComponents: 0
> PComponents: [0x1 double]
> mu: []
> Sigma: []
> NlogL: []
> AIC: []
> BIC: []
> Converged: []
> Iters: []
> SharedCov: []
> CovType: []
> RegV: 0
> Methods
> Methods for class gmdistribution:
> gmdistribution Static methods:
> fit

This is not the display I expected, which makes me even more suspicious that
you have a gmdistribution function that's taking precedence over the
Statistics Toolbox one or have modified the gmdistribution files in the
Toolbox or that your installation of Statistics Toolbox is incomplete or

Steve Lord
To contact Technical Support use the Contact Us link on

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.