发布时间:2024-02-05 17:30
提示:以下是本篇文章正文内容,下面案例可供参考
1)在Simulink界面新建一个空的Library模块
1)打开Mtalab的帮助文档,搜索Slblock>>Add Library to the Library Browser
2)复制Slblocks脚本命令
function blkStruct = slblocks
% This function specifies that the library 'mylib'
% should appear in the Library Browser with the
% name 'My Library'
Browser.Library = 'mylib';
% 'mylib' is the name of the library
Browser.Name = 'My Library';
% 'My Library' is the library name that appears
% in the Library Browser
blkStruct.Browser = Browser;
1)在Mtalab界面新建一个脚本文件,并填入上面的代码
2)编辑需要添加的Library模块的名称(Slx文件)以及在Library Browser上面展示的名称
3)保存脚本文件
1)在Library Browser列表左侧,右键选择Refresh Library Browser或者按F5更新Library列表
综上完成Simulink Library的添加;