You can set the ColumnFormat
property of the uitable to be any string that the format command
accepts. For example, if your table has one column you can set the property to {'short g'}
(it has to be a cell array, one value per column).
Note that although the format
command accepts shortg
, in some releases of MATLAB the ColumnFormat
property only accepts short g
with a space (I think this is a bug).
If you need a number of significant figure that is not provided by one of the options to the format
command, the best solution I've found is to set all the column formats to char
, and convert numerical contents to strings myself using the more flexible capabilities of sprintf
.