Main Content

getFlags

Retrieve flags from Safety Analysis Manager spreadsheets

Since R2023b

Description

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

example

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

example

flags = getFlags(spreadsheetRow) returns the flags in a spreadsheet row. (since R2024b)

example

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

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 SpreadsheetRow objects for the rows.

for n = 1:mySpreadsheet.Rows
  myRows(n) = getRow(mySpreadsheet,n);
end

Add a warning flag to the first and second rows.

addFlag(myRows(1),"warning")
addFlag(myRows(2),"warning")

Retrieve the flag from the first row.

myFlags = getFlags(myRows(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.

Since R2024b

Row in the Safety Analysis Manager spreadsheet, specified as a SpreadsheetRow object.

Output Arguments

collapse all

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

Version History

Introduced in R2023b

expand all