Contenu principal

save

R2026b

Save Safety Analysis Manager document

Since R2023b

Description

save(spreadsheet,fileName) saves the Safety Analysis Manager spreadsheet, spreadsheet, to the file name fileName.

example

save(faultTreeDocument,fileName) saves the Safety Analysis Manager fault tree document, faultTreeDocument, to the file name. (since R2026b)

example

Examples

collapse all

Create a new spreadsheet.

mySpreadsheet = safetyAnalysisMgr.newSpreadsheet;

Add three rows to the spreadsheet.

addRow(mySpreadsheet,Count=3)

Add a text and check box column to the spreadsheet.

addColumn(mySpreadsheet,Count=2,Type=["text","checkbox"])

Update the labels of the new columns.

setColumnLabel(mySpreadsheet,2,"text column");
setColumnLabel(mySpreadsheet,3,"checkbox column");

Save the spreadsheet with the name myNewSpreadsheet to the current folder.

save(mySpreadsheet,"myNewSpreadsheet.mldatx")

Since R2026b

Create a new fault tree document.

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

Get the top-level gate and add a basic event to it.

myTopGate = myFaultTreeDoc.Gates(1);
myEvent = createEvent(myTopGate);

Save the fault tree document with the name myNewFaultTreeDoc to the current folder.

save(myFaultTreeDoc,"myNewFaultTreeDoc.mldatx")

Input Arguments

collapse all

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

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

File name of the document file, specified as a string scalar or character vector. When specifying the spreadsheet file name, the .mldatx extension is optional (since R2026b). If you do not want to save the file in the current folder, specify the path and the file name.

Data Types: char | string

Version History

Introduced in R2023b

expand all