Main Content

close

Close spreadsheet in Safety Analysis Manager

Since R2023b

Description

example

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

example

close(spreadsheet,Force=status) closes the spreadsheet with or without the need to save based on the status, status.

Examples

collapse all

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

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

save(mySpreadsheet,"mySpreadsheet.mldatx")

Close the spreadsheet.

close(mySpreadsheet)

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.

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