Match NaN's in one Matrix to another

조회 수: 1 (최근 30일)
Robert
Robert 2016년 2월 24일
답변: the cyclist 2016년 2월 24일
Consider 2 matrices
A = [1, 2, 3, 4;
5, 6, 7, 8]
B = [NaN NaN 1 1;
NaN 1 1 NaN]
How can
C = [NaN NaN 3 4;
NaN 6 7 NaN]
I can do this for an individual row or column but can't get it to work for matrix. Thanks in advance for any help

채택된 답변

the cyclist
the cyclist 2016년 2월 24일
C = A;
C(isnan(B)) = NaN

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by