Main Content

getColumnTypes

Retrieve column types in spreadsheet in Safety Analysis Manager

Since R2024b

Description

types = getColumnTypes(spreadsheet) returns the column types in the spreadsheet, spreadsheet, in the Safety Analysis Manager.

example

Examples

collapse all

Create a new spreadsheet.

mySpreadsheet = safetyAnalysisMgr.newSpreadsheet;

Add a text column, a check box column, and a derived column.

addColumn(mySpreadsheet,Type="text")
addColumn(mySpreadsheet,Type="checkbox")
addColumn(mySpreadsheet,Type="derived")

Retrieve the column types.

getColumnTypes(mySpreadsheet)
ans = 

  1×4 string array

    "text"    "text"    "checkbox"    "derived"

Suppose you have one open spreadsheet that has three columns. The first two are text columns, and the last is an enumeration column that uses an enumeration class named WeekDays. To get the column types, retrieve the spreadsheet.

mySpreadsheet = safetyAnalysisMgr.getOpenDocuments;

Get the column types.

getColumnTypes(mySpreadsheet)
ans = 

  1×3 string array

    "text"    "text"    "WeekDays"

Input Arguments

collapse all

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

Output Arguments

collapse all

Column types in the spreadsheet, returned as a string array. Each element can contain one of these options:

TypeDescription
"text"The column accepts text in the cell values.
"checkbox"The column accepts a logical in the cell values. The values display as a check box.
"derived"The column produces values derived from a formula. To set to column formula, use the setColumnFormula function.
enumeration class name

The column accepts values specified in an enumeration class defined on the path. For more information, see Create an Enumeration Column.

Version History

Introduced in R2024b

See Also

Functions

Objects