Create a conditional formatting Color Scale Table like Excel
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!