主要内容

safetyAnalysisMgr.newDocument

R2026b

Create new document in Safety Analysis Manager

Since R2026b

Description

document = safetyAnalysisMgr.newDocument(type) creates a Safety Analysis Manager document of the specified document type.

example

document = safetyAnalysisMgr.newDocument(templateFile) creates a document by using the specified template file.

example

document = safetyAnalysisMgr.newDocument(group,templateName) creates a new document by using the template, templateName, in the template group, group.

example

Examples

collapse all

Create a spreadsheet in the Safety Analysis Manager.

mySpreadsheet = safetyAnalysisMgr.newDocument("spreadsheet")
mySpreadsheet = 

  Spreadsheet with properties:

           Rows: 1
        Columns: 1
       FileName: ''
    Description: '

Create a fault tree document in the Safety Analysis Manager.

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

  FaultTreeDocument with properties:

       FaultTrees: [1×1 safetyAnalysisMgr.FaultTree]
           Events: [1×0 safetyAnalysisMgr.Event]
    FailureModels: [1×0 safetyAnalysisMgr.FailureModel]
            Gates: [1×1 safetyAnalysisMgr.Gate]
       EvalConfig: [1×1 struct]
         FileName: ''
      Description: ''

Suppose you have a template in the current working folder, myTemplate.mldatx, that has three columns. Create a spreadsheet in the Safety Analysis Manager that uses this template.

mySpreadsheet = ...
safetyAnalysisMgr.newDocument("myTemplate.mldatx");
mySpreadsheet = 

  Spreadsheet with properties:

    FileName: ''
        Rows: 1
     Columns: 3
 Description: ''

Create a spreadsheet in the Safety Analysis Manager that uses the FMEA template from the built-in group, MW_Aerospace_Templates.

mySpreadsheet = ...
safetyAnalysisMgr.newDocument("MW_Aerospace_Templates","FMEA");
mySpreadsheet = 

  Spreadsheet with properties:

    FileName: ''
        Rows: 1
     Columns: 7
 Description: ''

Input Arguments

collapse all

Document type, specified as "spreadsheet" or "fault-tree".

Template file name, specified as a string scalar or character vector. You must specify an MLDATX file, and the argument must include the .mldatx extension. If the file is not in the current folder, specify the path and the file name.

Data Types: char | string

Registered template group, specified as "MW_Aerospace_Templates" or a string scalar or character vector that contains the name of the custom template group. For more information on how to register custom templates and groups, Register Safety Analysis Manager Templates.

Data Types: char | string

Registered template name in the group, group, specified as a string scalar or character vector. The MW_Aerospace_Templates built-in group includes these templates:

Template NameDescription
"FMEA"An example Failure Mode and Effects Analysis (FMEA) template.
"AFHA"An example Aircraft Functional Hazard Assessment (AFHA) template.
"SFHA"An example System Functional Hazard Assessment (SFHA) template.

Data Types: char | string

Output Arguments

collapse all

New document in the Safety Analysis Manager, returned as a Spreadsheet or FaultTreeDocument object.

Version History

Introduced in R2026b

expand all