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

조회 수: 2 (최근 30일)
Xiu
Xiu 2012년 7월 11일
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
Xiu
Xiu 2012년 7월 11일
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.
Sean de Wolski
Sean de Wolski 2012년 7월 11일
편집: Sean de Wolski 2012년 7월 11일
Excellent!
Xiu, please write your comment as an answer and accept it to mark this question closed!

댓글을 달려면 로그인하십시오.

채택된 답변

Xiu
Xiu 2012년 7월 11일
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개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by