how to convert a matrix given in range 5 to 1000 into matrix 0 to 255
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
studentambitious
el 20 de Sept. de 2016
Comentada: Walter Roberson
el 21 de Sept. de 2016
I have a matrix whose values lies in range from 5 to 1000. I want to convert it into he range of 0 to 255. please mention how to revert back to same range of 5 to 1000. please help
Respuesta aceptada
Walter Roberson
el 20 de Sept. de 2016
round( (Matrix - 5) / (1000-5) * 255 )
2 comentarios
Walter Roberson
el 21 de Sept. de 2016
Restored = double(Scaled_Matrix) * (1000-5)/255 + 5;
Note that you lose resolution when you do this: you will not be able to restore to exactly the same as the original.
Más respuestas (0)
Ver también
Categorías
Más información sobre Shifting and Sorting Matrices 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!