Removing NaN values in Structure

조회 수: 8 (최근 30일)
Diego Fonseca
Diego Fonseca 2019년 6월 11일
댓글: Diego Fonseca 2019년 6월 11일
Hello!
I have a struct called "modelo" that contains (among other variables) a numeric variable called "Val", which is 41714x81X29. There are random NaN's scattered throughout the data in this struct and I would like to remove them, creating a new variable without any NaN. I have tried writng:
modelo2 = modelo(~isnan([modelo.Val(:,:,:]));
but it says "Index exceeds matrix dimensions".
Does anyone could helpe me, please?

채택된 답변

madhan ravi
madhan ravi 2019년 6월 11일
modelo2 = modelo.Val(~isnan(modelo.Val));
  댓글 수: 1
Diego Fonseca
Diego Fonseca 2019년 6월 11일
Thanks a lot, Madhan Ravi! It worked fine!

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

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by