Main Content

swapRows

Class: Simulink.dialog.parameter.CustomTable
Namespace: Simulink.dialog.parameter

Swap two existing rows in a custom table

Syntax

tableControl.swapRows(rowIndex1, rowIndex2)

Description

tableControl.swapRows(rowIndex1, rowIndex2)swaps specified rows in a custom table.

Input Arguments

expand all

Handle to the custom table, specified as an object. You can use the getDialogControl command to get the custom table handle. For more information, see Simulink.dialog.Container.getDialogControl.

Consider, for example, tableControl = maskObj.getDialogControl(TableName). Here, maskObj is the mask object and TableName is the name of the custom table.

Data Types: integer

Row index number of the first row to be swapped with another row.

For example, '4'.

Row index number of the second row to be swapped with another row.

For example, '5'.

Examples

% Get block mask handle.
maskObj = Simulink.Mask.get(gcb); 

% Get custom table handle.
tableControl = maskObj.getDialogControl('myTable');

% Swap rows 3 and 6.
tableControl.swapRows(3,6); 

Version History

Introduced in R2019a