主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

systemcomposer.exportModel

将模型信息导出为 MATLAB

    说明

    [exportedSet] = systemcomposer.exportModel(modelName) 导出组件、端口、连接器、端口接口和需求链接的模型信息,并将域字段导入 MATLAB® 表。对于软件架构,编程接口还导出函数信息。导出的表有规定的格式,用于指定模型元素关系、构造型和属性。有关导入结构的更多信息,请参阅 importModel 函数和导入和导出架构模型

    示例

    [exportedSet,errorLog] = systemcomposer.exportModel(modelName) 导出要导入 MATLAB 表中的模型信息,输出参量 exportedSet 包含导出表的结构,errorLog 用于显示导出错误信息。

    示例

    全部折叠

    要导出模型,需将模型名称作为参量传递给 exportModel 函数。函数返回一个包含五个表的结构:componentsportsconnectionsportInterfacesrequirementLinksparameters,其中 domain 字段返回为 'System'(架构模型)和 'Software'(软件架构模型)。

    exportedSet = systemcomposer.exportModel('exMobileRobot')
    
    exportedSet = 
    
      struct with fields:
    
              components: [3×4 table]
                   ports: [3×5 table]
             connections: [1×4 table]
          portInterfaces: [3×9 table]
        requirementLinks: [4×15 table]
              parameters: [6×9 table]
                  domain: 'System'

    要导出软件架构模型,请将模型名称作为参量传递给 exportModel 函数。函数返回一个包含 7 个表的结构:componentsportsconnectionsportInterfacesrequirementLinksparametersdomain 作为 'Software'functions

    exportedSet = systemcomposer.exportModel('mySoftwareArchitectureModel')
    
    exportedSet = 
    
      struct with fields:
    
              components: [2×5 table]
                   ports: [0×4 table]
             connections: [0×4 table]
          portInterfaces: [0×9 table]
        requirementLinks: [0×15 table]
              parameters: [0×9 table]
                  domain: 'Software'
               functions: [1×4 table]

    输入参数

    全部折叠

    模型名称,指定为字符向量或字符串。

    示例: "exMobileRobot"

    数据类型: char | string

    输出参量

    全部折叠

    模型表,以包含 componentsportsconnectionsportInterfacesrequirementLinksparameters 表的结构形式返回,其中 domain 字段以 'System' 的形式返回用于架构模型,以 'Software' 的形式返回用于软件架构模型。对于软件架构,模型表包括一个 functions 表,用于导出函数信息。

    数据类型: struct

    导出过程中报告的错误,以字符串数组形式返回。您可以通过调用字符串数组上的 disp 方法来获取错误文本。例如,disp(exportLog) 用于获取以字符串形式报告的可读格式错误。

    数据类型: string

    详细信息

    全部折叠

    版本历史记录

    在 R2019a 中推出