how to replace missing values from a double inside a cell array?

조회 수: 1 (최근 30일)
I really thanks in advance anybody can tell me how can I replace THE missing values (100000) in the below cell array with NaN.
A = {[1,2,3,100000,4,5,100000],[6,100000,7,100000]};

채택된 답변

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH 2020년 2월 5일
newA=cellfun(@(x) x.*(x~=100000)./(x~=100000),A,'Uni',false)

추가 답변 (1개)

BN
BN 2020년 2월 5일
편집: BN 2020년 2월 5일
index=find(A==100000); %found 100000 in the A
A(index)=NaN; % Replace them by NaN
  댓글 수: 2
JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH 2020년 2월 5일
'==' does not work with argument of type cell
BN
BN 2020년 2월 5일
Dear JESUS,
You are right, It's my bad. Thank you for letting me know

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

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by