Create a conditional formatting Color Scale Table like Excel
이전 댓글 표시
Hello,
I am trying to create a Color Scale table similar to the one you can have from Excel. I would like the color of each cell to change based on the value in that cell compared to all values of the table or the values in that column.
For example, I have this table and I want to set the colour from red to green, where red is the smallest value in each column and green the highest:
x=[1,5,3;2,7,8;9,2,4]
x =
1 5 3
2 7 8
9 2 4
Using the sort function I can find the index of each element sorted in columns and in an ascending order.
[sX sInd]=sort(x);
sInd =
1 3 1
2 1 3
3 2 2
Now, I don't know how to use these data in order to create a uitable similar to this one:

Thanks in advance.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!