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

1 回表示 (過去 30 日間)
Amir Azadeh Ranjbar
Amir Azadeh Ranjbar 2022 年 2 月 24 日
編集済み: Ankit 2022 年 9 月 2 日
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 Center および File ExchangeDevelop 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