create a picture with matrix
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Leon Phung
el 7 de Jun. de 2018
Respondida: Walter Roberson
el 7 de Jun. de 2018
Is it possible to create a black&white image from a matrix with 0 and 1? for example, matrix 50x25 (each element represent a pixel) randomly filled with 0 and 1 (assume black = 0 and white = 1), then use that to draw a picture.
0 comentarios
Respuesta aceptada
Más respuestas (1)
Rishabh Rathore
el 7 de Jun. de 2018
Here's what I understand from your question, you have a matrix of 0s and 1s and want to generate a binary (black and white) image.
You can convert any 2d matrix to grayscale (black and white) image using 'mat2gray' function
And since your matrix only contains 0 or 1 so your image would contain only black or white, no gray levels.
Ver también
Categorías
Más información sobre Modify Image Colors en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!