How can I convert a matrix into a number?
Mostrar comentarios más antiguos
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 comentario
per isakson
el 12 de Mzo. de 2014
Try the function sprintf
Respuesta aceptada
Más respuestas (1)
per isakson
el 12 de Mzo. de 2014
Try
>> sprintf( '%1d', matrix )
ans =
1101011
Categorías
Más información sobre Matrices and Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!