根据simulink的help文档建立自定义模块库:
1.在 Simulink Start Page 上,选择 Blank Library 并点击 Create Library。
2.建立一个mylib的文件,里面包含自建的clark变换函数;
3.在 MATLAB® 命令提示符下,输入以下命令以启用模型属性EnableLBRepository。当您保存库时,只有此属性设置为 on,您的库才会出现在浏览器中。
set_param(gcs,'EnableLBRepository','on');
4、在 MATLAB 中,右键点击您保存库的文件夹,并选择 New File > Script。将文件命名为 slblocks.m。
function blkStruct = slblocks
% This function specifies that the library should appear
% in the Library Browser
% and be cached in the browser repository
Browser.Library = 'mylib';
% 'mylib' is the name of the library
Browser.Name = 'My Library'