Donnerstag, 24. Februar 2011

S-Function

The S-function demo library opens:
open_system([matlabroot,'/toolbox/simulink/simdemos/simfeatures/sfundemos.mdl']);

MATLAB S-Function Example:
1. Implement an S-function with an inherited sample time:
edit('msfcn_dsc.m');open_system('msfcndemo_sfundsc1.mdl');

2. Implement a continuous limited integrator where the output is bounded by lower and upper bounds and includes initial conditions.
edit('msfcn_limintm.m');open_system('msfcndemo_limintm.mdl');

3. Implement a multirate system
edit('msfcn_multirate.m');open_system('msfcndemo_multirate.mdl');

4. Implement an S-function that doubles its input
edit('msfcn_times_two.m');open_system('msfcndemo_timestwo.mdl');

5. Implement a unit delay
edit('msfcn_unit_delay.m');open_system('msfcndemo_sfundsc2.mdl');

6. Implement a variable pulse width generator by calling set_param from within a Level-2 MATLAB S-function. Also demonstrates how to use custom set and get methods for the block SimState.
edit('msfcn_varpulse.m');open_system('msfcndemo_varpulse.mdl');  

7. Implement a variable sample time block in which the first input is delayed by an amount of time determined by the second input.
edit('msfcn_vs.m');open_system('msfcndemo_vsfunc.mdl');  



 






Using S-function blocks in Simulink
http://www.chem.mtu.edu/~tbco/cm416/MatlabTutorialPart5.pdf

Keine Kommentare:

Kommentar veröffentlichen