Converting matrix to binary matrix and then saving the matrix to excel
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hafeez
el 9 de Dic. de 2016
Comentada: Hafeez
el 9 de Dic. de 2016
Hi.I want to export image matrix in binary format to excel,I have used dec2bin to covert my image matrix into binary format.The problem i am facing is that the dec2bin coverts the image matrxi into binary vector, i want the results in matrix form and then stored in the excel as rows and coloums.code is attached.
A=imread('lena.tiff');
x=dec2bin(A,8)
xlswrite('bin.xlsx', cellstr(x))
0 comentarios
Respuesta aceptada
Guillaume
el 9 de Dic. de 2016
Editada: Guillaume
el 9 de Dic. de 2016
As pointed out by Walter in your previous identical question, dec2bin does not convert into a binary vector but into a char matrix.
It's not clear what your new question is asking. If you're asking how to reshape that cell array that is the result of cellstr into the same shape as your image, then simply use reshape
xlswrite('bin.xlsx', reshape(cellstr(x), size(A)))
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Type Conversion en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!