How can I convert a matrix into a number?
古いコメントを表示
suppose I have a matrix:
matrix=[1 1 0 1 0 1 1]
then I want it to be
1101011.
I used mat2str, num2str but it didn't satisfied me.
Thankyou! More power to you guys!
1 件のコメント
per isakson
2014 年 3 月 12 日
Try the function sprintf
採用された回答
その他の回答 (1 件)
per isakson
2014 年 3 月 12 日
Try
>> sprintf( '%1d', matrix )
ans =
1101011
カテゴリ
ヘルプ センター および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!