主要内容

Simscape 文件部署

R2026b
在模块图中使用 Simscape™ 文件

通过将文本组件文件转换为自定义 Simscape 模块,可以在模块图中部署这些组件。您可以使用 Simscape Component 模块将 Simscape 组件文件快速变换为模型中的模块。您还可以构建 Simscape 组件的自定义模块库,从而在整个组织中共享这些模型。有关这两种方法的详细信息,请参阅Generating Custom Blocks from Simscape Component Files。

Simscape 模块

Simscape Component blockSimscape ComponentDeploy Simscape language component as block

函数

sscbuildBuild custom library from collection of Simscape files (自 R2024b 起)
ssc_build(To be removed) Build custom library from collection of Simscape files
sscmirrorCreate protected mirror of library of Simscape files (自 R2024b 起)
ssc_mirror(To be removed) Create protected mirror of library of Simscape files
sscprotectGenerate Simscape protected files from source files (自 R2024b 起)
ssc_protect(To be removed) Generate Simscape protected files from source files
sl_postprocessMake postprocessing customizations when building custom block library
ssccleanClean all derived files generated by library build process (自 R2024b 起)
ssc_clean(To be removed) Clean all derived files generated by library build process
ssc_updateUpdate Simscape component files to use new syntax
simscape.dependency.fileCheck dependencies for single file
simscape.dependency.libCheck dependencies for library namespace
simscape.dependency.modelCheck dependencies for model
subsystem2sscConvert subsystem containing Simscape blocks into equivalent Simscape file or files

主题

自定义组件部署的基本方法

自定义模块在图中的显示

  • Customizing the Block Name and Appearance
    How to customize the block name, names of parameters, variables, and ports, and the block icon.
  • 自定义模块显示
    此示例展示了一个包含注解的完整组件文件,以及生成的库模块和对话框。图像文件 custom_spring.svg 与组件文件位于同一文件夹中。此示例说明了Customizing the Block Name and Appearance中所述的基本方法。
  • Use Advanced Techniques to Customize Block Display
    This example shows how you can use block layout annotation and enumerations to improve usability of a custom block.

自定义模块库

案例研究