changing the structure of a matrix according to a characteristic matrix
조회 수: 3 (최근 30일)
이전 댓글 표시
I have a matrix (I am calling it characteristic):
0 1 1
0 0 1
1 1 1
and another one (which has to be changed):
b =
9 8 7
3 2 7
4 5 3
What I want is to make certain operation on b to remove elements that are in the position of 0 in matrix
.
0 8 7
0 0 7
4 5 3
Any idea how to do it?
댓글 수: 0
채택된 답변
Sudhakar Shinde
2020년 10월 22일
편집: Sudhakar Shinde
2020년 10월 22일
Use elementwise (.) operator :
Xa=[0 1 1;0 0 1;1 1 1]
b=[9 8 7;3 2 7;4 5 3]
b.*Xa
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!