How to change element in base 10 to base 2 in a matrix, with loops and while
조회 수: 6 (최근 30일)
이전 댓글 표시
Suppose i have a matrix called A,the elements ib base 10,how do i convert to base 2 .with conditions and loops.
댓글 수: 14
Walter Roberson
2017년 9월 24일
variable(count) = lastbit;
Yes, mod(current_num,2) is fine to extract the last bit.
답변 (1개)
Jose Marques
2017년 9월 9일
A = magic(5) %generating a matrix 5x5
A = (A<10) %suppose you want the elements in A < 10
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
