主要内容

moveRow

R2026b

Change position of row in Safety Analysis Manager spreadsheet by row index

Since R2026b

Description

moveRow(spreadsheet,fromPosition,toPosition) moves the row at index fromPosition to the index toPosition in the Safety Analysis Manager spreadsheet, spreadsheet.

example

Examples

collapse all

Create a new spreadsheet and add three rows.

mySpreadsheet = safetyAnalysisMgr.newSpreadsheet;
addRow(mySpreadsheet,Count=3)

Move the first row to the third position.

moveRow(mySpreadsheet,1,3)

Input Arguments

collapse all

Spreadsheet in the Safety Analysis Manager, specified as a Spreadsheet object.

Index of the row to move, specified as a positive integer. The index of the topmost row of the spreadsheet is 1.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

New index for the row, specified as a positive integer.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Tips

  • To move a row using a SpreadsheetRow object, use the move function.

  • To retrieve a row from a spreadsheet, use the getRow function.

Version History

Introduced in R2026b