I want the data above the specified threshold to be colored in the table (in app designer)

1 view (last 30 days)
d=table2array(app.data);
d=rmmissing(d);
[Coeff,P]=corrcoef(d);
app.UITable5.ColumnName=app.VarNames;
app.UITable5.Data=Coeff;
app.UITable5.RowName=app.VarNames;
app.UITable6.ColumnName=app.VarNames;
app.UITable6.Data=P;
app.UITable6.RowName=app.VarNames;
nr=size(app.UITable5.Data,1);
nc=size(app.UITable5.Data,2);
t=app.TCorrelationEditField.Value;
for i=1:nr
for j=1:nc
if app.UITable5.Data(i,j)>=t
app.UITable5.BackgroundColor(i,j)=[1 0 0];
end
end
end
  1 Comment
Ankit
Ankit on 2 Sep 2022
Edited: Ankit on 2 Sep 2022
which MATLAB version you are using?
app.OutputTable.BackgroundColor; % this will return the uitable background color
Add style to table or tree UI component - MATLAB addStyle - MathWorks Deutschland - if you are using version 2019a (here you can find some example too

Sign in to comment.

Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!