How to filter out rows with NaNs from one variable and the same rows from another variable without NaNs.

2 ビュー (過去 30 日間)
Ngial
Ngial 2018 年 7 月 24 日
回答済み: Paolo 2018 年 7 月 24 日
I have a numerical variable X [506x24706] and a numerical variable Y [506x1]. Variable Y includes some NaNs. How can I filter out rows with NaNs from Y and at the same time filter out the same corresponding rows from X and create a new Y and a new X?

回答 (1 件)

Paolo
Paolo 2018 年 7 月 24 日
indx = isnan(Y);
Y(indx) = [];
X(indx,:) = [];

カテゴリ

Help Center および File ExchangeFrequency Transformations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by