Main Content

addFlag

Add flag to Safety Analysis Manager cell

Since R2023b

Description

example

addFlag(cell,flagType) adds a flag to the spreadsheet cell, cell, in the Safety Analysis Manager.

example

addFlag(cell,flagType,Name=Value) adds a flag to the spreadsheet cell using one or more name-value arguments.

Examples

collapse all

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")

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

collapse all

Cell in the Safety Analysis Manager spreadsheet, specified as a SpreadsheetCell object.

Type of flag, specified as one of these values:

ValueDescription
"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.

Flag description, specified as a string scalar or character vector.

Data Types: char | string

Flag tag, specified as a string scalar or character vector.

Data Types: char | string

Version History

Introduced in R2023b