How can change ColumnName of table with for loop in matlab?

114 Views Asked by At
x = [];
x = ['A':'Z'];
for i='A':'Z'
    for j='A':'Z'
        x = [cellstr(x),[i,j]];
    end
end
for i=1:100
    app.UITable.ColumnName ={x(i)};
end

I want to change ColumnNames with x characters but it doesn't work with above code. Hhow can I solve this problem?

1

There are 1 best solutions below

0
On

If you want to rename only in a special index you can use

app.UITable.ColumnName =x(i+1);

if you want to name all table columns in a for loop, you can use this script

x = [];
x = ['A':'Z'];
for i='A':'Z'
    for j='A':'Z'
        x = [cellstr(x),[i,j]];
    end
end
for i=1:100
    app.UITable.ColumnName{1,i} =x(i+1);
end