Hey everyone,
Clearly my syntax is off. I have seen my a post about this and tried many ways but I keep getting errors, particularly
Error using subsindex
Function 'subsindex' is not defined for values of class
'cell'.
I would like to remove the entire row of data if [] is found in the 3rd column. I read a post that said this error is often returned when I have a variable with a similar name to a matlab function but when I do the following that doesn't seem to be the case.
>> which data
data is a variable.
Here is the final code I tired:
>> data(cellfun(@(x)x(~isempty(x)), data(:,3),'un',0),:)= []
Error using subsindex
Function 'subsindex' is not defined for values of class
'cell'.
Attached is my file! Thank you!

댓글 수: 4

Jens
Jens 2014년 5월 8일
counter = 0; for n = 1:size(ERAW_HWstid605_30yrs,1); if isempty(ERAW_HWstid605_30yrs{n,3}) == false; counter = counter + 1; for m = 1:size(ERAW_HWstid605_30yrs,2); cleandata{counter,m} = ERAW_HWstid605_30yrs{n,m}; end; end; end;
mashtine
mashtine 2014년 5월 8일
You should put this as an answer so you can get those great points! Thank you very much for this!
Jens
Jens 2014년 5월 8일
just happy to help.
mashtine
mashtine 2014년 5월 8일
Well you are certainly appreciated. Many thanks, one day I will return the favour to someone

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

 채택된 답변

A Jenkins
A Jenkins 2014년 5월 8일

1 개 추천

data(cellfun(@(x) isempty(x), data(:,3)),:)=[]

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

질문:

2014년 5월 8일

댓글:

2014년 5월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by