getColumnTypes
Description
returns the column types in the spreadsheet, types
= getColumnTypes(spreadsheet
)spreadsheet
, in the
Safety Analysis Manager.
Examples
Get Column Types of Spreadsheet in Safety Analysis Manager
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"
Get Enumeration Column Types in Spreadsheet
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
spreadsheet
— Spreadsheet in Safety Analysis Manager
Spreadsheet
object
Spreadsheet in the Safety Analysis Manager, specified as a
Spreadsheet
object.
Output Arguments
types
— Column types
string array
Column types in the spreadsheet, returned as a string array. Each element can contain one of these options:
Type | Description |
---|---|
"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
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)