
If the array has fewer values than the number of columns, then the columns with no specified value are not editable.Ī logical scalar - The entire table is editable or uneditable. If the array has more values than the number of columns, MATLAB ignores the excess values.

A value of false makes the cells in that column uneditable. A value of true in the array makes the cells in that column editable. Each value in the array corresponds to a table column. The value of n is equal to the number of columns in the table.
#Matlab help table update
Width persists even if you later update the ColumnWidthĮxample: uit = uitable(uifigure,'ColumnWidth','auto','Data',)Įxample: uit = uitable(uifigure,'ColumnWidth','fit','Data',)Įxample: uit = uitable(uifigure,'ColumnWidth','Data',)Īn empty logical array ( ) - No columns are editable.Ī logical 1-by- n array - This array specifies which columns are editable.

If a user interactively resizes a table column in a running app, the resized column With consideration for the remaining space in the UI table. Specify a cell array with character vectors or strings composed of a numberĮach column sets that column width proportionally with respect to the others, Weighted variable widths ( uifigure-based apps only). If the array has more values than the number of columns, MATLAB ignores the extra values. If the cell array you specify has fewer values than the number of columns, then the columns with no specified value keep the default value of 'auto'. Each element in the cell array corresponds to a column in the table. Uniform widths ( uifigure-based apps only) - Specify a value of '1x' to make all columns the same width, dividing the available space equally.įixed widths - Specify a cell array of numeric values that define the column widths in pixel units.Ĭombinations - You can combine fixed and variable column widths in a cell array. This setting allows narrower columns than 'auto' does. See the ColumnFormat propertyĪutomatic widths - Specify 'auto' to have MATLAB calculate the widths of the columns automatically using several factors, one of which is the ColumnName property value.įit widths to content ( uifigure-based apps only) - Specify a value of 'fit' to configure columns to strictly adjust widths to fit column names and data. Ifĭata is edited and results in a mismatch between the data type of the data and theĬolumnFormat property, MATLAB converts the data or displays a warning. Numeric, logical, cell, or string array, or a cell array of character vectors. Use the ColumnFormat property to specify the format for data that is a Specify Numeric, Logical, Cell, String Array, or Cell Array of Character Vectors If you try to set the ColumnFormat property, MATLAB returns a warning.įor more information on displaying table array data, see Display Tabular Data in Apps.

The data type of each table array variable controls formatting for the corresponding column in the app. Changing the RowName property of the Table UI component updates the UI, but it does not update the row names in the table array. Changing the ColumnName property of the Table UI component updates the UI, but it does not update the variable names in the table array.īy default, the row names displayed in the app match the RowName property of the table array. When you specify the Data property of a Table UI component as a table array, then MATLAB sets the format of the Table UI component automatically based on the values in the table array:īy default, the column names displayed in the app match the VariableNames property of the table array. By contrast, the uitable function creates a Table UI component (a user interface component for an app). The table, readtable, and array2table functions create table arrays.

Table arrays provide a convenient way to store tabular data as a MATLAB variable. In App Designer and apps created using the uifigure function, you can specify the Data property as a table array. When a user edits a cell, the Data property updates. To prevent warnings or NaN values that display when users enter invalid data into an editable cell, write a CellEditCallback function to convert the data to the appropriate type. String array - Displays characters and text.Ĭell array of character vectors - Displays characters and text. true values correspond to selected boxes, whereas false values display cleared boxes.Ĭell array - Displays any combination of numeric, logical, or character array values. Numeric array - Displays numeric values such as double or single. Table array ( uifigure-based apps only) - Displays any combination of data types that table arrays support, such as datetime, duration, and categorical.
