mapping a matrix to array to new matrix (mapping image to tone image )
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
daniel zayed
el 4 de Nov. de 2018
Comentada: daniel zayed
el 5 de Nov. de 2018
i have a matrix A n*m for example A,3*3 = A[0,3,10;255,6,8;7,9,9] the values between 0 to 255 and i have array B 1*256 that includes all the numbers from 0 to 255 not sorted , (ex. [5,0,4,255,...]) i need to map the matrix A to B - for every value i in A i want to map it to B(i+1) i am required to do it in one line code !!!
in this example the first element in A 0 will convert to 5 index 1 in B and second element 3 will be 255 index 4 in B in the new matrix .
0 comentarios
Respuesta aceptada
Image Analyst
el 5 de Nov. de 2018
How about intlut()?
A = uint8([0,3,10;255,6,8;7,9,9])
B = uint8(randperm(256)-1)
output = intlut(A, B) % A and B must be integers
Más respuestas (1)
Ver también
Categorías
Más información sobre Matrix Indexing 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!