Displaying a user-defined library in the simulink library browser

1 次查看(过去 30 天)
Hello,
I believe this question is simple and I am just misinterpretting something in the documentation. I have created my own library called PackNTxLib. I would like to add it to the Library Browser. I followed the product documentation and it isn't working so I must have misinterpreted something in the documentation. I did the following: 1. Under My MatLab directory (i.e. My Documents/<myusername>/MatLab) I created a folder called PackNTxLib. 2. In that folder I added my model library (PackNTxLib.mdl) 3. In that folder I created an slblock.m file that contains the following: function blkStruct = slblocks Browser.Library = 'PackNTxLib'; Browser.Name = 'Pack N Transmit'; blkStruct.Browser = Browser;
I have run the file and get no errors. Then I bring up the simulink library browser and my library isn't there. Am I supposed to look somewhere else? Am I missing something in my .m file? Do I have my folder in the wrong place? I figure this is something simple I am doing wrong. Thanks!

采纳的回答

Kaustubha Govind
Kaustubha Govind 2011-7-1
Have you added My Documents/<myusername>/MatLab/PackNTxLib to the MATLAB path? Once you have done that, run:
which -all slblocks
And make sure that your slblocks.m shows up in the list.
  1 个评论
Jill
Jill 2011-7-1
Yes, I have added the path to my MATLAB path. When I type the "which" command, my slblocks.m file is not listed. All the files that are listed are under c:\Program Files\MATLAB.... Not anything from My Documents directory.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Debugging and Analysis 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by