how to convert decimal to binary???
3 ビュー (過去 30 日間)
古いコメントを表示
I want to convert the elements of multi dimensional matrix from decimal format to binary format and store it in the same multi-dimensional matrix. Using de2bi() function i get a 'nx1' matrix. Is there any other way of doing this conversion and get the binary values in the same matrix of same dimension as the inputted decimal matrix.
eg: a[1,2,3,4;5,6,7,8;9,10,11,12;13,14,15,16]
to
a[00001,00010,00011,00100;00101,00110,00111,01000;01001,01010,01011,01100;01101,01110,01111,10000]
Please help :) Thanks in advance :)
0 件のコメント
回答 (1 件)
Jan
2012 年 7 月 11 日
The converion to "binary" create strings. Strings are vectors of type char. You cannot store vectors in arrays in the same way as scalars. Do you want to create a cell string?
0 件のコメント
参考
カテゴリ
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!