uitable ColumnFormat for n columns
8 次查看(过去 30 天)
显示 更早的评论
I am new to Matlab and have a question regarding uitable 'ColumnFormat'. I would like to format all the column data in my uitable to 2 decimal places via format bank. How do I accomplish this if my data has n columns? I have the following code to create the table:
table = uitable(f,'data',cpf,'Position',[40 20 1000 770],'ColumnName',WOBvect,'ColumnFormat',columnformat,'RowName',Nvect);
I would like columnformat to be a vector of the size of WOBvect such that every element of the array, cpf, displayed in the uitable has 2 decimal places. I realize 'bank' may accomplish this, but how do I apply that to each column WITHOUT having to list the column names. The number of columns will vary with the size of WOBvect.
Thank you in advance!
0 个评论
采纳的回答
Walter Roberson
2012-1-27
Before that call,
columnformat = repmat({'bank'}, length(WOBvect), 1);
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!