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
>> sprintf( '%1d', matrix )
ans =
1101011
类别
在 帮助中心 和 File Exchange 中查找有关 Numeric Types 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!