SLBLOCKS Defines the block library for a specific Toolbox or Blockset. SLBLOCKS returns information about a Blockset to Simulink. The information returned is in the form of a BlocksetStruct with the following fields: Name Name of the Blockset in the Simulink block library Blocksets & Toolboxes subsystem. OpenFcn MATLAB expression (function) to call when you double-click on the block in the Blocksets & Toolboxes subsystem. MaskDisplay Optional field that specifies the Mask Display commands to use for the block in the Blocksets & Toolboxes subsystem. Browser Array of Simulink Library Browser structures, described below. The Simulink Library Browser needs to know which libraries in your Blockset it should show, and what names to give them. To provide this information, define an array of Browser data structures with one array element for each library to display in the Simulink Library Browser. Each array element has two fields: Library File name of the library (mdl-file) to include in the Library Browser. Name Name displayed for the library in the Library Browser window. Note that the Name is not required to be the same as the mdl-file name. Example: % % Define the BlocksetStruct for the Simulink block libraries % Only simulink_extras shows up in Blocksets & Toolboxes % blkStruct.Name = ['Simulink' sprintf('\n') 'Extras']; blkStruct.OpenFcn = simulink_extras; blkStruct.MaskDisplay = disp('Simulink\nExtras'); % % Both simulink and simulink_extras show up in the Library Browser. % blkStruct.Browser(1).Library = 'simulink'; blkStruct.Browser(1).Name = 'Simulink'; blkStruct.Browser(2).Library = 'simulink_extras'; blkStruct.Browser(2).Name = 'Simulink Extras'; See also FINDBLIB, LIBBROWSE.
0001 function blkStruct = slblocks 0002 %SLBLOCKS Defines the block library for a specific Toolbox or Blockset. 0003 % SLBLOCKS returns information about a Blockset to Simulink. The 0004 % information returned is in the form of a BlocksetStruct with the 0005 % following fields: 0006 % 0007 % Name Name of the Blockset in the Simulink block library 0008 % Blocksets & Toolboxes subsystem. 0009 % OpenFcn MATLAB expression (function) to call when you 0010 % double-click on the block in the Blocksets & Toolboxes 0011 % subsystem. 0012 % MaskDisplay Optional field that specifies the Mask Display commands 0013 % to use for the block in the Blocksets & Toolboxes 0014 % subsystem. 0015 % Browser Array of Simulink Library Browser structures, described 0016 % below. 0017 % 0018 % The Simulink Library Browser needs to know which libraries in your 0019 % Blockset it should show, and what names to give them. To provide 0020 % this information, define an array of Browser data structures with one 0021 % array element for each library to display in the Simulink Library 0022 % Browser. Each array element has two fields: 0023 % 0024 % Library File name of the library (mdl-file) to include in the 0025 % Library Browser. 0026 % Name Name displayed for the library in the Library Browser 0027 % window. Note that the Name is not required to be the 0028 % same as the mdl-file name. 0029 % 0030 % Example: 0031 % 0032 % % 0033 % % Define the BlocksetStruct for the Simulink block libraries 0034 % % Only simulink_extras shows up in Blocksets & Toolboxes 0035 % % 0036 % blkStruct.Name = ['Simulink' sprintf('\n') 'Extras']; 0037 % blkStruct.OpenFcn = simulink_extras; 0038 % blkStruct.MaskDisplay = disp('Simulink\nExtras'); 0039 % 0040 % % 0041 % % Both simulink and simulink_extras show up in the Library Browser. 0042 % % 0043 % blkStruct.Browser(1).Library = 'simulink'; 0044 % blkStruct.Browser(1).Name = 'Simulink'; 0045 % blkStruct.Browser(2).Library = 'simulink_extras'; 0046 % blkStruct.Browser(2).Name = 'Simulink Extras'; 0047 % 0048 % See also FINDBLIB, LIBBROWSE. 0049 0050 % Copyright 1990-2006 The MathWorks, Inc. 0051 % $Id: slblocks.m,v 1.1 2008/03/01 13:43:20 nicola Exp $ 0052 0053 % 0054 % Name of the subsystem which will show up in the Simulink Blocksets 0055 % and Toolboxes subsystem. 0056 % 0057 blkStruct.Name = ['LTPDA' sprintf('\n') 'Package']; 0058 0059 % 0060 % The function that will be called when the user double-clicks on 0061 % this icon. 0062 % 0063 blkStruct.OpenFcn = 'ltpdalib'; 0064 0065 % 0066 % The argument to be set as the Mask Display for the subsystem. You 0067 % may comment this line out if no specific mask is desired. 0068 % Example: blkStruct.MaskDisplay = 'plot([0:2*pi],sin([0:2*pi]));'; 0069 % No display for Simulink Extras. 0070 % 0071 %blkStruct.MaskDisplay = ''; 0072 0073 % 0074 % Define the Browser structure array, the first element contains the 0075 % information for the Simulink block library and the second for the 0076 % Simulink Extras block library. 0077 % 0078 % Browser(1).Library = 'simulink'; 0079 % Browser(1).Name = 'Simulink'; 0080 % Browser(1).IsFlat = 0;% Is this library "flat" (i.e. no subsystems)? 0081 0082 Browser(2).Library = 'ltpda_library'; 0083 Browser(2).Name = 'LTPDA Library'; 0084 Browser(2).IsFlat = 0; 0085 0086 blkStruct.Browser = Browser; 0087 clear Browser; 0088 0089 % 0090 % Define information about Signal Viewers 0091 % 0092 Viewer(1).Library = 'simviewers'; 0093 Viewer(1).Name = 'Simulink'; 0094 0095 blkStruct.Viewer = Viewer; 0096 clear Viewer; 0097 0098 % 0099 % Define information about Signal Generators 0100 % 0101 Generator(1).Library = 'simgens'; 0102 Generator(1).Name = 'Simulink'; 0103 0104 blkStruct.Generator = Generator; 0105 clear Generator; 0106 0107 % Define information for model updater 0108 %blkStruct.ModelUpdaterMethods.fhDetermineBrokenLinks = @UpdateSimulinkBrokenLinksMappingHelper; 0109 blkStruct.ModelUpdaterMethods.fhUpdateModel = @UpdateSimulinkBlocksHelper; 0110 0111 % End of slblocks 0112 0113