How to reassign the label?

2 次查看(过去 30 天)
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

采纳的回答

Walter Roberson
Walter Roberson 2015-12-7
final_outcome = value(matrix);
No loop needed.
  2 个评论
Tan Wen Kun
Tan Wen Kun 2015-12-7
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)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by