主要内容

close

R2026b

Close document in Safety Analysis Manager

Since R2023b

Description

close(spreadsheet) closes the specified spreadsheet in the Safety Analysis Manager.

example

close(faultTreeDocument) closes the specified fault tree document in the Safety Analysis Manager. (since R2026b)

example

close(___,Force=status) closes the Safety Analysis Manager spreadsheet or fault tree document without the need to save based on the status, status.

example

Examples

collapse all

Create a new spreadsheet in the Safety Analysis Manager.

mySpreadsheet = safetyAnalysisMgr.newSpreadsheet;

Save the spreadsheet with the name mySpreadsheet in the current folder.

save(mySpreadsheet,"mySpreadsheet.mldatx")

Close the spreadsheet.

close(mySpreadsheet)

Since R2026b

Create a new fault tree document in the Safety Analysis Manager.

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

Save the fault tree document with the name myFaultTreeDoc in the current folder.

save(myTreeDoc,"myFaultTreeDoc.mldatx")

Close the spreadsheet.

close(myTreeDoc)

Create a new spreadsheet in the Safety Analysis Manager.

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 column labels.

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

Close the spreadsheet without saving.

close(mySpreadsheet,Force=true)

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.

Whether the spreadsheet can close without saving, specified as a numeric or logical 1 (true) or 0 (false).

Data Types: logical

Version History

Introduced in R2023b

expand all