Main Content

DocumentFlag

Flags in Safety Analysis Manager

Since R2023b

Description

DocumentFlag objects represent flags in Safety Analysis Manager spreadsheet cells and rows. Use DocumentFlag objects to configure flags you use for safety analyses.

Creation

To create a DocumentFlag object:

  • Use the getFlags function to retrieve the flags in a Safety Analysis Manager spreadsheet, spreadsheet row, or spreadsheet cell.

  • Use the addFlag function to add flags to a Safety Analysis Manager spreadsheet row or spreadsheet cell (since R2026a).

Properties

expand all

This property is read-only.

Type of flag, represented as one of these values:

ValueDescription
'error'

An error flag. Cells and rows with an error flag display the error icon .

'warning'

A warning flag. Cells and rows with a warning flag display the warning icon .

'check'

A check flag. Cells and rows with a check flag display the check icon .

To specify this property, define the flagType argument when you use the addFlag function.

Data Types: enumeration

This property is read-only.

Description of the flag, represented as a character vector.

To specify this property, define the Description name-value argument when you use the addFlag function.

Data Types: char

This property is read-only.

Flag tag, represented as a character vector.

To specify this property, define the Tag name-value argument when you use the addFlag function.

Data Types: char

This property is read-only.

Cell or row in the Safety Analysis Manager spreadsheet that contains the flag, represented as a SpreadsheetCell (since R2023b) or SpreadsheetRow (since R2024b) object.

Object Functions

clearClear Safety Analysis Manager document flag

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.

myFlag = addFlag(myCells(1),"warning");
myFlag2 = 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");
addFlag(myCells(2),"warning");

Retrieve the DocumentFlag objects from the cells as an array of DocumentFlag objects.

myFlags = getFlags(myCells(1));

Version History

Introduced in R2023b

expand all