Main Content


Adjust column label of spreadsheet in Safety Analysis Manager

Since R2023b



setColumnLabel(spreadsheet,column,newLabel) adjusts the label of the column, column, in the Safety Analysis Manager spreadsheet, spreadsheet, to the specified label.


collapse all

Suppose that only one spreadsheet is loaded in the Safety Analysis Manager. Retrieve the Spreadsheet object of the spreadsheet.

mySpreadsheet = safetyAnalysisMgr.getOpenDocuments;

Set the label of the second column to new_label.


Create a new spreadsheet in the Safety Analysis Manager.

mySpreadsheet = safetyAnalysisMgr.newSpreadsheet;

Add three columns to the spreadsheet.


Update the column with the label here.

setColumnLabel(mySpreadsheet,"here","still here")

Input Arguments

collapse all

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

Column location in the spreadsheet, specified as a positive integer, string scalar, or character vector. Use a positive integer to specify the column index, and use a string scalar or character vector to specify the column by its label. The index starts of leftmost column of the spreadsheet is 1.

To find the number or columns in the spreadsheet, retrieve the Columns property of the Spreadsheet object used in spreadsheet. To find the column labels, use the getColumnLabels function on the Spreadsheet object.

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

Updated column label, specified as string scalar or character vector.

Data Types: char | string

Version History

Introduced in R2023b