apply a different condition to 2 columns
이전 댓글 표시
Hi guys. I have a matrix 2*2 and I want to apply 1 condition to each column to get a new matrix of the same size. EX a= '0.4317' '0.9203' '0.7011' '0.4612' Condition column 1 = if X<0.5 then Y=1 otherwise y=0. the condition for the second column would be the opposite. following those conditions matrix b= '1' '1' '1''0'.
댓글 수: 3
Stephan
2018년 11월 2일
Are you sure that
b=[1 1; 0 1]
?
Should not b be:
b = [1 0; 1 0]
in your example?
Andres Serrano
2018년 11월 2일
Andres Serrano
2018년 11월 2일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 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!