필터 지우기
필터 지우기

Extract overlay matrix containing the same number

조회 수: 4 (최근 30일)
Phat Pumchawsaun
Phat Pumchawsaun 2018년 2월 11일
답변: John D'Errico 2018년 2월 11일
Hi,
I have two matrix as example below
A=
[0 1 2
3 4 5
0 9 0]
B=
[0 1 4
3 0 5
0 9 1]
I want to extract only overlay cell containing the same number as following;
C=
[0 1 0
3 0 5
0 9 0]
Could you please help me for that
Thanks Phat

답변 (1개)

John D'Errico
John D'Errico 2018년 2월 11일
Easy peasy, the MATLAB way.
C = A.*(A == B);

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by