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

조회 수: 1 (최근 30일)
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
Ankit
Ankit 2022년 9월 2일
편집: Ankit 2022년 9월 2일
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

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by