필터 지우기
필터 지우기

VERY simple question about adding 2 matrices

조회 수: 1 (최근 30일)
Mohsen
Mohsen 2014년 3월 17일
댓글: Mohsen 2014년 3월 17일
Matrix A and B have the same size: 512 x 512 x 105.
I want each element of matrix A to be equal to the corresponding element in matrix B when that element in matrix B is greater than zero.
How can I write this without a for loop?
Thank you very much!!

채택된 답변

Walter Roberson
Walter Roberson 2014년 3월 17일
A(B>0) = B(B>0);

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by