Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Error using 'mvregress' function

Asked by Dusan Kojic on 15 Dec 2012

I'm trying to use 'mvregress' function to fit Y matrix (3400x9) of dependent variables, using X matrix of observations (3400(observations) x 900 (variables)).

Y matrix has a lot of 0s, but otherwise all positive numbers between 0.7 and 1300.

When I type beta = mvregress(X,Y)

I get the error message: ??? Undefined function or method 'isnan' for input arguments of type 'cell'.

Error in ==> mvregress at 238 if isempty(EstMethod) && ~any(isnan(Data(:)))

What am I doing wrong or how can I overcome this ?

Thanks a lot ! Dusan

1 Comment

Walter Roberson on 15 Dec 2012

Please show

class(X)
class(Y)
Dusan Kojic

Tags

1 Answer

Answer by Shashank Prasanna on 12 Jan 2013

From the error it appears that the X or Y or both may be cell instead of matrices. You can verify that by using class as Walter mentioned or running the >>whos command. Convert them to matrices by using cell2mat http://www.mathworks.com/help/matlab/ref/cell2mat.html

0 Comments

Shashank Prasanna

Contact us