MATLAB Answers

App Designer UITable row names change once writing the output to the UITable

12 views (last 30 days)
farzad
farzad on 30 Apr 2020
Commented: Adam Danz on 1 May 2020
Hi All
for a UITable I have create in app designer , I have also defined names for each rows :
R1,
R2,
R3,...
but once I finish the calculations and want to write these values to the UITable, this names change to numbers suddenly !!!
1,
2,
3,

  0 Comments

Sign in to comment.

Accepted Answer

Adam Danz
Adam Danz on 30 Apr 2020
Edited: Adam Danz on 1 May 2020
Option 1: Create a table with row names and load the table into a uitable.
T = array2table(rand(3,2),'VariableNames',{'A','B'},'RowNames',{'i','ii','iii'});
uif = uifigure();
uitable(uif, 'Data', T)
Option 2: Create the uitable directly
uif = uifigure();
T = uitable(uif, 'Data',rand(3,2),'ColumnName',{'A','B'},'RowName',{'i','ii','iii'});
To update an existing app
app.UITable.Data = rand(3,2); % update data
app.UITable.ColumnName = {'A','B'};
app.UITable.RowName = {'i','ii','iii'};

  13 Comments

Adam Danz
Adam Danz on 1 May 2020
Good find! Although, this line from my answer should have fixed that unless the line you described came afterwards.
app.UITable.RowName = {'i','ii','iii'};
farzad
farzad on 1 May 2020
Exactly ! I tried it as well, I think I learnt well from this question ,thank you

Sign in to comment.

More Answers (0)


Translated by