Two matrices comparison
조회 수: 1 (최근 30일)
이전 댓글 표시
%I have two matrices, a=[1 2 3]; b=[0 1 0]; %How can i get a1=a if b=1 and a1=0 if b=0, So that a1=[0 2 0]?Thanks!
댓글 수: 0
채택된 답변
Ellen
2012년 6월 16일
a1=a.*b;
the dot before the multiplication sign makes sure the multiplication is done elment by element, so a1(1)=a(1)*b(1)......
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!