A model becomes a referenced model when a Model block in anothermodel references it. Any model canfunction as a referenced model, and can continue to function as a separatemodel.当模型块在另一个模型中引用时,模型就变成了引用模型。任何模型都可以作为参考模型,并且可以继续作为单独的模型运行。
1如果包含要引用的模型的文件夹不在MATLAB路径上,则添加文件夹到MATLAB路径。
2Create an instance of theModel block in the parent model. The new block is initially unresolved becauseitdoesnotspecifyareferencedmodel.在父模型中创建Model块的实例。新块最初无法解析,因为它没有指定引用的模型。
3.要打开块参数对话框,双击Model块。
4.在“模型名称”字段中输入引用的模型的名称。此名称必须包含少于60个字符,不包括。或者。
重点来了,下面我们来演示一编如果还不会把文件添加到路径百度一下
打开sldemo_mdlref_basic模型,通过view/modelexplorer可以看到模型浏览器有两个模型,最下面那个是被引用的,可以右键模型打开看具体模型结构,如图所示
下面我们按照上面的步骤来建立引用模型首先view/library browser打开模型库浏览器找到子系统组
就是这个模块了,把他拖到模型编辑器双击在弹出方框model name中填入你想要引用的模型名即可