Main Content

setDocumentAttribute

R2026b

Set document attributes in Safety Analysis Manager documents

Since R2023b

Description

setDocumentAttribute(spreadsheet,property,value) sets the value, value, of the document attribute with the property, property, in the Safety Analysis Manager spreadsheet, spreadsheet.

example

setDocumentAttribute(faultTreeDocument,property,value) sets the value of the document attribute with the specified property in the Safety Analysis Manager fault tree document, faultTreeDocument. (since R2026b)

Examples

collapse all

Create a new spreadsheet in the Safety Analysis Manager.

mySpreadsheet = safetyAnalysisMgr.newSpreadsheet;

Add a document attribute to the spreadsheet by using the addDocumentAttribute function.

addDocumentAttribute(mySpreadsheet,property="myAttribute1")

Set the attribute value to 100.

setDocumentAttribute(mySpreadsheet,"myAttribute1","100")

Since R2026b

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

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

Add a document attribute to the fault tree document by using the addDocumentAttribute function.

addDocumentAttribute(myFaultTreeDoc,property="myAttribute1")

Set the attribute value to 100.

setDocumentAttribute(myFaultTreeDoc,"myAttribute1","100")

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.

Property of the document attribute, specified as a string scalar or character vector.

Data Types: char | string

Value of the document attribute, specified as a string scalar or character vector.

Data Types: char | string

Version History

Introduced in R2023b

expand all