Main Content

deleteColumn

Delete column in spreadsheet in Safety Analysis Manager

Since R2023b

Description

example

deleteColumn(spreadsheet,column) deletes the specified column, column, in the spreadsheet, spreadsheet in the Safety Analysis Manager.

Examples

collapse all

Create a new spreadsheet in the Safety Analysis Manager.

mySpreadsheet = safetyAnalysisMgr.newSpreadsheet;

Add three columns to the spreadsheet.

addColumn(mySpreadsheet,Count=3)

Delete the third column.

deleteColmun(mySpreadsheet,3)

Create a new spreadsheet in the Safety Analysis Manager.

mySpreadsheet = safetyAnalysisMgr.newSpreadsheet;

Add three columns to the spreadsheet with the labels here, there, and everywhere.

addColumn(mySpreadsheet,Count=3,Label=["here","there","everywhere"])

Delete the column with the label everywhere.

deleteColmun(mySpreadsheet,"everywhere")

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

Version History

Introduced in R2023b