please find attached file, I tried to replace missing values (-1.27605887595352e+39) with NaN, unfortunately I encountering with the following error. Thanks in advance any help.
INDEX = cellfun(@(x) (x<-1),presglb,'UniformOutput',false) ;
>> presglb_new = presglb(INDEX);
Function 'subsindex' is not defined for values of class 'cell'.

 채택된 답변

Bhaskar R
Bhaskar R 2020년 2월 11일
편집: Bhaskar R 2020년 2월 11일

1 개 추천

ind = cellfun(@(x) (x<-1),presglb,'UniformOutput',false);
for ii =1 :length(presglb)
presglb{ii}(ind{ii}) = nan;
end

댓글 수: 7

"ind" is corresponding to what?
is corresponding to the element below?
ind = cellfun(@(x) (x<-1),presglb,'UniformOutput',false) ;
Bhaskar R
Bhaskar R 2020년 2월 11일
Forgot to mention, now post is edited.
Yes, I got it thanks
Bhaskar R
Bhaskar R 2020년 2월 11일
You are welcom :-)
Dear Bhaskar, after getting new presglb, you know how can I remove NaN?
Thanks
I know the following way, but the double size in the cell has changed, I want to keep the size as before.
>> result = cellfun(@(x) x(~isnan(x)), presglb, 'Uniform', 0);

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

추가 답변 (0개)

카테고리

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

태그

질문:

2020년 2월 11일

댓글:

2020년 2월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by