How to modify UTTable cell color in app designer
Afficher commentaires plus anciens
I built a calculator where I want the color of the value to change if the sum is within a certain range of values. So, I need to know if there is any coloring command I can use.
if app.SecondOrderCheckBox.Value == 1 && app.LowerBandCheckBox.Value == 1
if app.SumCheckBox.Value==1
while i<22
j=1;
while j<12
ut.Data(i,j) = secsum+b;
x=secsum+b;
% if x>5210 && x<5250
%I want to change the color of x from black to any other color and then insert it to the table
% ut.Data(i,j) = x;
% end
b = b-5;
j=j+1;
end
b=0;
b=b-r;
r = r+5;
i = i+1;
end

Réponses (1)
Hi,
To change the color of cell values dynamically you can use "uistyle" or addstyle".
Refer to these documentation links below:
- https://www.mathworks.com/help/releases/R2025a/matlab/ref/uitable.html#:~:text=Style%20rows%2C%20columns%2C%20or%20cells%20of%20a%20table%20UI%20component%20using%20the%20uistyle%20and%20addStyle%20functions
- https://www.mathworks.com/help/releases/R2025a/matlab/ref/uistyle.html#:~:text=Create%20multiple%20styles%20and%20add%20them%20to%20different%20parts%20of%20a%20table%20UI%20component.
- https://www.mathworks.com/help/releases/R2025a/matlab/ref/matlab.ui.control.table.addstyle.html#:~:text=Create%20multiple%20styles%20and%20add%20them%20to%20different%20parts%20of%20a%20table%20UI%20component.
Hope this helps!
Catégories
En savoir plus sur Develop Apps Using App Designer dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!