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

1 visualización (últimos 30 días)
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 comentario
Ankit
Ankit el 2 de Sept. de 2022
Editada: Ankit el 2 de Sept. de 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

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by