Main Content

getFlags

Retrieve flags from Safety Analysis Manager spreadsheets

Since R2023b

Description

example

flags = getFlags(spreadsheet) returns the flags in the specified Safety Analysis Manager spreadsheet.

example

flags = getFlags(cell) returns the flags in a spreadsheet cell.

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

Retrieve the flags in the spreadsheet.

myFlags = getFlags(mySpreadsheet);

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 flags from the cell in the first row.

myFlags = getFlags(myCells(1));

Input Arguments

collapse all

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

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

Output Arguments

collapse all

Spreadsheet or spreadsheet cell flags, returned as a DocumentFlag object array.

Version History

Introduced in R2023b