Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

编程式模型编辑

以编程方式创建模型、在模型中添加和连接模块、设置参数和属性以及执行其他基本建模操作。

了解 Simulink® 中编程式模型管理的基础知识。

函数

全部展开

simulink打开 Simulink 起始页
start_simulink启动 Simulink 而不打开任何窗口
slLibraryBrowser打开、加载并关闭 Simulink 库浏览器,创建并获取库浏览器对象的句柄
open_system打开模型、库、子系统或模块对话框
load_systemSimulink 模型加载到内存中
save_system保存 Simulink 模型
close_system关闭 Simulink 模型窗口或模块对话框
bdclose无条件关闭任何或所有 Simulink 模型窗口
learning.simulink.launchOnramp打开自定进度的交互式培训
add_block向模型中添加模块
add_lineSimulink 模型中添加信号线
delete_blockSimulink 系统中删除模块
delete_lineSimulink 模型中删除信号线
add_paramAdd parameter to Simulink model
delete_paramDelete model parameter added with add_param function
Simulink.BlockDiagram.deleteContentsDelete graphical contents of model
Simulink.SubSystem.deleteContents删除子系统的内容
Simulink.history.clearClear the Simulink start page and editor history (自 R2020b 起)
new_system在内存中创建 Simulink 模型或库
Simulink.createFromTemplateCreate model or project from template
Simulink.BlockDiagram.createSubsystem创建包含指定模块集的子系统
Simulink.Annotation创建并指定文本注释、图像注释和区域注释的属性
docblockGet or set editor invoked by Simulink DocBlock block
gcs获取当前系统的路径名称
getfullname获取标识模块或信号线的路径
gcb获取当前模块的路径名称
gcbh获取当前模块的句柄
gcbp获取当前模块的 Simulink.BlockPath 对象
getSimulinkBlockHandle从模块路径中获取模块句柄
get_param获取参数名称和值
set_param设置 Simulink 参数值
Simulink.defaultModelTemplateSet or get default model template
getCurrentAnnotationGet current annotation object
getCallbackAnnotationGet annotation executing callback
edittime.getDisplayIssuesCheck whether model design warnings and errors are on
edittime.setDisplayIssuesDetect model design errors and warnings
hilite_system突出显示模块、信号线、端口或注释
find_system查找模型、模块、信号线、端口和注释
Simulink.FindOptionsSpecify options for finding blocks in models and subsystems
Simulink.findTemplatesFind model or project templates with specified properties
Simulink.allBlockDiagramsFind loaded Simulink models and libraries
Simulink.findBlocksSimulink 模型中查找模块
Simulink.findBlocksOfTypeSimulink 模型中查找指定类型的模块
replace_block替换 Simulink 模型中的模块
modelfinderSearch and open examples, models, and projects (自 R2022a 起)
modelfinder.setDefaultDatabaseSet default database to index models (自 R2023b 起)
modelfinder.registerFolderIndex models in Model Finder (自 R2022a 起)
modelfinder.unregisterFolderRemove models from Model Finder (自 R2022a 起)
modelfinder.createDatabaseCreate new database to index models (自 R2023b 起)
modelfinder.registerDatabaseImport database to Model Finder (自 R2023b 起)
modelfinder.unregisterDatabaseRemove database from Model Finder (自 R2023b 起)
modelfinder.setSearchDatabaseSet search scope to find models (自 R2023b 起)
isSimulinkStartedCheck whether Simulink is started (自 R2020b 起)
bdroot当前系统的顶层模型
bdIsLoadedDetermine whether model, subsystem, or library is loaded
bdIsLibraryDetermine whether model is library
bdIsDirtyDetermine whether model, subsystem, or library has unsaved changes
slIsFileChangedOnDiskDetermine whether model has changed since it was loaded
Simulink.SubSystem.copyContentsToBlockDiagram将图形内容从子系统复制到另一个模型
Simulink.exportToTemplateCreate template from model or project
Simulink.exportToVersion导出模型、库或工程,用于 Simulink 的以前版本
Simulink.MDLInfo在不加载文件的情况下提取 SLX、SLXP 或 MDL 文件信息
Simulink.MDLInfo.getDescriptionExtract SLX, SLXP, or MDL file description without loading file
Simulink.MDLInfo.getMetadataExtract SLX, SLXP, or MDL file metadata without loading file
Simulink.BlockDiagram.expandSubsystemReplace subsystem with subsystem contents
Simulink.BlockDiagram.arrangeSystemImprove layout of block diagram
Simulink.BlockDiagram.routeLineRoute existing lines of model
slCharacterEncoding指定要在从 Simulink 模型生成的代码中使用的编码
frameeditOpen PrintFrame Editor to edit print frames for Simulink and Stateflow block diagrams
orient打印或保存时使用的纸张方向
print打印图窗或保存为特定文件格式

主题