メインコンテンツ

getFlags

R2026b

Retrieve flags from Safety Analysis Manager documents

Since R2023b

Description

Spreadsheets

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

Fault Tree Documents

flags = getFlags(faultTreeDocument) returns the flags in the specified Safety Analysis Manager fault tree document.

example

flags = getFlags(event) returns the flags in a fault tree document event.

example

flags = getFlags(gate) returns the flags in a fault tree document gate.

example

flags = getFlags(failureModel) returns the flags in a fault tree document failure model.

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

Since R2024b

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

Since R2026b

Create a new Safety Analysis Manager fault tree document.

myFaultTreeDoc = safetyAnalysisMgr.newDocument("fault-tree");

Retrieve the fault tree from the document.

myFaultTree = myFaultTreeDoc(1).FaultTrees(1);

New fault trees contain one top-level gate. Retrieve the gate.

myGate = myFaultTree.Gates(1);

Add two basic events to the gate.

myEvent1 = createEvent(myGate);
myEvent2 = createEvent(myGate);

Add a check flag to the top-level gate and the first event.

addFlag(myGate,"check");
addFlag(myEvent1,"check");

Retrieve the flags in the fault tree document.

myFlags = getFlags(myFaultTreeDoc);

Since R2026b

Create a new Safety Analysis Manager fault tree document.

myFaultTreeDoc = safetyAnalysisMgr.newDocument("fault-tree");

Retrieve the fault tree from the document.

myFaultTree = myFaultTreeDoc(1).FaultTrees(1);

New fault trees contain one top-level gate. Retrieve the gate.

myGate = myFaultTree.Gates(1);

Add two basic events to the gate.

myEvent1 = createEvent(myGate);
myEvent2 = createEvent(myGate);

Add a check flag to the top-level gate and the first event.

addFlag(myGate,"check");
addFlag(myEvent1,"check");

Get the flag from the event.

myFlag = getFlags(myEvent1);

Since R2026b

Create a new Safety Analysis Manager fault tree document.

myFaultTreeDoc = safetyAnalysisMgr.newDocument("fault-tree");

Retrieve the fault tree from the document.

myFaultTree = myFaultTreeDoc(1).FaultTrees(1);

New fault trees contain one top-level gate. Retrieve the gate.

myGate = myFaultTree.Gates(1);

Add two basic events to the gate.

myEvent1 = createEvent(myGate);
myEvent2 = createEvent(myGate);

Add a check flag to the top-level gate and the first event.

addFlag(myGate,"check");
addFlag(myEvent1,"check");

Retrieve the flag from the gate.

myFlag = getFlags(myGate);

Since R2026b

Create a new Safety Analysis Manager fault tree document.

myFaultTreeDoc = safetyAnalysisMgr.newDocument("fault-tree");

Retrieve the fault tree from the document.

myFaultTree = myFaultTreeDoc(1).FaultTrees(1);

New fault trees contain one top-level gate. Retrieve the gate.

myGate = myFaultTree.Gates(1);

Add two basic events to the gate.

myEvent1 = createEvent(myGate);
myEvent2 = createEvent(myGate);

Each new event has a unique failure model. Retrieve the failure model from each event.

myFailureModel1 = myEvent1.FailureModel;
myFailureModel2 = myEvent2.FailureModel;

Add a check flag to the first failure model, and a warning flag to the second event.

addFlag(myFailureModel1,"check");
addFlag(myFailureModel2,"warning");

Get the flag from the first failure model.

myFlag = getFlags(myFailureModel1);

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.

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

Fault tree document in the Safety Analysis Manager, specified as a FaultTreeDocument object.

Event in the Safety Analysis Manager fault tree document, specified as an Event object.

Gate in the Safety Analysis Manager fault tree document, specified as a Gate object.

Failure model in the Safety Analysis Manager fault tree document, specified as a FailureModel object.

Output Arguments

collapse all

Document or document artifact flags, returned as a DocumentFlag object array.

Version History

Introduced in R2023b

expand all