MATLAB Answers

Xiu
0

error in 'isempty(x)' when x is in the class of dataset

Asked by Xiu
on 11 Jul 2012

Hi,

I have problems using function isempty(x) when x is in the class of dataset. For example,

>> x=randn(100,10); >> xx=dataset(x); >> isempty(xx) ??? Reference to non-existent field 'nobs'.

Error in ==> dataset.isempty at 11 t = (a.nobs == 0) (a.nvars == 0);

I think this is because when I use 'dataset', only certain fields are created, which does not include the field 'nobs'. When isempty.m tries to locate this field, the error occurs. However, I am not sure how to solve this problem. Can anyone help me with this please?

Thanks in advance.

  8 Comments

Not reproducing for me on 12a:

   x=randn(100,10);
 xx=dataset(x); 
 isempty(xx) 
Xiu
on 11 Jul 2012

I have figured the problem. I have additional toolbox in my matlab which contains another dataset.m file. Once I removed it, it is working perfectly fine. Thanks for all your helps.

Excellent!

Xiu, please write your comment as an answer and accept it to mark this question closed!

Products

No products are associated with this question.

1 Answer

Answer by Xiu
on 11 Jul 2012
 Accepted answer

I have figured out this problem. I have additional toolbox installed which overlaps the function dataset. Once I have it removed, everything is working fine.

  0 Comments


Join the 15-year community celebration.

Play games and win prizes!

Learn more
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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!