필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How can delete same rows and colums from three 2D matrices?

조회 수: 2 (최근 30일)
Szabó-Takács Beáta
Szabó-Takács Beáta 2015년 9월 16일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi All, I have three 2D matrices: longitude (191x177), latitude(191x177) and A(191x177). Matrix "A" contains some NaN values. I would like to delete the rows and colums which contain NaN in A from both matrices. Could someone suggest me a solution? Thank you for your help in advance!

답변 (2개)

Matt J
Matt J 2015년 9월 16일
map=isnan(A);
J=any(map,1);
I=any(map,2);
longitude(I,J)=[];
latitude(I,J)=[];

Thorsten
Thorsten 2015년 9월 16일
ind = isnan(A);
longitude(:, any(ind)) = []; % delete columns
longitude(any(ind'), :) = []; % delete rows

이 질문은 마감되었습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by