Borrar filtros
Borrar filtros

How to reassign the label?

2 visualizaciones (últimos 30 días)
Tan Wen Kun
Tan Wen Kun el 7 de Dic. de 2015
Comentada: Walter Roberson el 7 de Dic. de 2015
I got a table which show
table =
label 1 2 3 4 5 6 7 8 9
value 1 2 2 2 5 6 7 5 5
matrix =
1 1 1 1 1 1 1 1
1 2 2 1 3 1 4 1
1 1 1 1 3 1 4 1
1 5 5 1 1 1 1 1
1 1 1 1 6 6 6 1
1 7 7 1 1 1 1 1
1 1 1 1 8 1 9 1
1 1 1 1 1 1 1 1
I want to loop the matrix and reassign the label follow the value of table
final outcome =
1 1 1 1 1 1 1 1
1 2 2 1 2 1 2 1
1 1 1 1 2 1 2 1
1 5 5 1 1 1 1 1
1 1 1 1 6 6 6 1
1 7 7 1 1 1 1 1
1 1 1 1 5 1 5 1
1 1 1 1 1 1 1 1

Respuesta aceptada

Walter Roberson
Walter Roberson el 7 de Dic. de 2015
final_outcome = value(matrix);
No loop needed.
  2 comentarios
Tan Wen Kun
Tan Wen Kun el 7 de Dic. de 2015
after get final_outcome, I want change to 3D matrix like
final_outcome =(:,:,1)
final_outcome =(:,:,2)
final_outcome =(:,:,3)
then I want to assign each label to a unique color like label 1 equal to black color(0,0,0)
label 2=white color(255,255,255)

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by