addFlag
Description
addFlag(
adds a flag to the spreadsheet cell, cell
,flagType
)cell
, in the Safety Analysis
Manager.
addFlag(
adds a flag to the spreadsheet cell using one or more name-value arguments.cell
,flagType
,Name=Value
)
Examples
Add Warning Flags to New Spreadsheet
Create a new Safety Analysis Manager spreadsheet.
mySpreadsheet = safetyAnalysisMgr.newSpreadsheet;
Add two text columns and two rows to the spreadsheet.
addRow(mySpreadsheet,Count=2) addColumn(mySpreadsheet,Count=2)
Retrieve the SpreadsheetCell
objects for the cells in the second
column.
for n = 1:mySpreadsheet.Rows myCells(n) = getCell(mySpreadsheet,n,2); end
Add a warning flag to the cells in the first and second row of the second column.
addFlag(myCells(1),"warning") addFlag(myCells(2),"warning")
Add Warning Flags with Descriptions
Create a new Safety Analysis Manager spreadsheet.
mySpreadsheet = safetyAnalysisMgr.newSpreadsheet;
Add two text columns and two rows to the spreadsheet.
addRow(mySpreadsheet,Count=2) addColumn(mySpreadsheet,Count=2)
Retrieve the SpreadsheetCell
objects for the cells in the second
column.
for n = 1:mySpreadsheet.Rows myCells(n) = getCell(mySpreadsheet,n,2); end
Add a warning flag to the cells in the first and second row of the second column.
addFlag(myCells(1),"warning",Description="This is a warning.") addFlag(myCells(2),"warning",Description="This is another warning.")
Input Arguments
cell
— Cell in Safety Analysis Manager
SpreadsheetCell
object
Cell in the Safety Analysis Manager spreadsheet, specified as a SpreadsheetCell
object.
flagType
— Type of flag
"error"
| "warning"
| "check"
Type of flag, specified as one of these values:
Value | Description |
---|---|
"error" | Creates an error flag. Cells with an error flag display the error icon . |
"warning" | Creates a warning flag. Cells with a warning flag display the warning icon . |
"check" | Creates a check flag. Cells with a check flag display the check icon . |
Data Types: enumeration
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: addFlag(myCell,"check",Description="This indicates a check.")
adds a check flag to the cell, myCell
, that has a
description.
Description
— Flag description
string scalar | character vector
Flag description, specified as a string scalar or character vector.
Data Types: char
| string
Tag
— Flag tag
string scalar | character vector
Flag tag, specified as a string scalar or character vector.
Data Types: char
| string
Version History
Introduced in R2023b
See Also
Objects
Functions
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)