Removing NaN values in Structure

15 ビュー (過去 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 Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by