How to remove NAN from a cell inside a cell array?

30 ビュー (過去 30 日間)
SUSHMA MB
SUSHMA MB 2017 年 2 月 27 日
コメント済み: SUSHMA MB 2017 年 2 月 27 日
Each cell in the cell array contains a matrix, e.g.,
Suppose the cell array is
[8x1] cell
Inside which their are some matrix like
[6x2] double
[7x2] double
[6x2] double
[7x2] double
[6x2] double
[7x2] double
[6x2] double
[7x2] double
Now in each matrix their is a NAN value at the end. How to remove the NAN from each of the cell inside the cell array.
  1 件のコメント
Walter Roberson
Walter Roberson 2017 年 2 月 27 日
Are there rows of NaN? Are there columns of NaN?
Are there single NaN? If there is a NaN which is not part of an all-NaN row or column, then what shape should the result be?

サインインしてコメントする。

採用された回答

KSSV
KSSV 2017 年 2 月 27 日
% make random data
A = cell(8,1) ;
for i = 1:8
A{i} = rand(7,2) ;
A{i}(8,:) = [NaN NaN] ;
end
%%remove nanas
for i = 1:8
A{i} = A{i}(~isnan(A{i}(:,1)),:) ;
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOperators and Elementary Operations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by