Unrecognized variable name 'rows'

조회 수: 9 (최근 30일)
SRI SINDHU S P
SRI SINDHU S P 2015년 9월 1일
편집: Brendan Hamm 2015년 9월 2일
S = dataset('xlsfile','nss.xlsx') h = randperm(size(S,1)) g = S(h(1:2300),:) l = ismember(S,g,'rows') S(l<0.5, :) where nss.xlsx is a spambase dataset. but i am getting an error like "Error using getvarindices (line 25) Unrecognized variable name 'rows'.
Error in dataset/ismember (line 34) avars = getvarindices(a,vars,false);
Error in trainandtestseparation (line 4) l = ismember(S,g,'rows')"

채택된 답변

Brendan Hamm
Brendan Hamm 2015년 9월 1일
편집: Brendan Hamm 2015년 9월 2일
You are trying to use this with a dataset, which will call the ismember method of this class and not the base MATLAB ismember. The documentation for the dataset version can be found here: ismember, but in this case you can just omit the 3rd input:
l = ismember(S,g)
Edit: Just realized I spelled MATLAB wrong. Rectified that situation.
  댓글 수: 1
SRI SINDHU S P
SRI SINDHU S P 2015년 9월 2일
Thanks a lot.. Its working... :-)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by