How can I convert a matrix into a number?
Show older comments
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 Comment
per isakson
on 12 Mar 2014
Try the function sprintf
Accepted Answer
More Answers (1)
per isakson
on 12 Mar 2014
Try
>> sprintf( '%1d', matrix )
ans =
1101011
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!