I have 2-D matrix having both positive and negative decimal integer I want to convert all elements of matrix to binary numbers. How can I do this?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have 2-D matrix having both positive and negative decimal numbers I want to convert all elements of matrix to binary numbers. How can I do this?
댓글 수: 0
답변 (1개)
Image Analyst
2017년 1월 28일
Try this:
binaryMatrix = yourMatrix > someThreshold; % such as yourMatrix > 0 or whatever number you want.
That's a binary matrix with 0's and 1's, actually false's and true's. If you want a binary like strings, use dec2bin().
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!