Binary value convert.
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a binary bit sequence A = [0 1 0 1;1 0 0 1; 0 0 0 1; 1 0 0 1]; How can i convert all the 0 values into -1.??
The final output will become as A = [-1 1 -1 1;1 -1 -1 1;-1 -1 -1 1;1 -1 -1 1];
댓글 수: 0
채택된 답변
Ameer Hamza
2021년 1월 2일
Read about logical indexing
A = [0 1 0 1;1 0 0 1; 0 0 0 1; 1 0 0 1];
A(A==0) = -1;
댓글 수: 3
Image Analyst
2021년 1월 2일
Offline private consulting is not usually done. Why can't you continue to get help here in the Answers forum, where everyone can benefit from the questions and answers?
Ameer Hamza
2021년 1월 2일
Yes, it is better to post your question on this forum so that you have a better chance of getting any help, and the answers will also be helpful for others.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!