Printing SIMULINK models
How do I print my SIMULINK model?
To print a SIMULINK block diagram, type print -f<systemname> at the MATLAB command line. You can use the options found in help print when printing a SIMULINK diagram.
If you are working on a Macintosh or a PC, you can print from the File menu, just as you would print a figure. Why doesn't the text on my SIMULINK diagram print out?
This was a bug in SIMULINK version 1.2 and MATLAB versions 4.0 thru 4.1.1. It has been fixed in SIMULINK version 1.3 and MATLAB version 4.2.
MATLAB Function block
Why can't I call any MATLAB function from the MATLAB Function block?
The MATLAB Function block can take any number of inputs, but it must return a vector as an output.
What is the difference between the MATLAB Function block and the function block?
The MATLAB Function block can perform any function in MATLAB, whether it is a function you have written or one that comes with MATLAB.
The Function block can use only a limited number of functions (the list of these functions can be found by clicking on Help in the function block). This block uses C routines to perform the calculations and is therefore very fast. General Questions
How do I mask SIMULINK blocks?
There is a technical note on masking SIMULINK blocks, which can be found in pub/tech-support/tech-notes/sim3.txt.
Why doesn't linmod return the correct results?
There is a technical note which explains the uses and limitations of linmod which can be found in pub/tech-support/tech-notes/sim2.txt.
Can SIMULINK handle complex signals?
No. The current releases through 1.3 are not designed to handle complex data. The real and imaginary parts must be separated and handled independently.
How do I use the set_param and get_param functions?
There is a technical note which explains how to use these two functions which can be found on the ftp server in pub/tech-support/tech-notes/sim6.txt.
S-functions
What is the flag ordering for S-functions?
SIMULINK makes calls with flags in the following order: 4, 3, 2, 1. It might not call all of these flags, but flag calls are always made in this order, whether or not some flags have been skipped.
How do I display values numerically, rather than graphically (with the scope)?
The following is an S-function example, which was written by one of the Technical Support Engineers:
function[sys,x0]=show(t,x,u,flag) if abs(flag)==0,
hs1=figure('units','normal','pos',[.8 .8 .1 .2]);
hs2=uicontrol(hs1,'style',...
'edit','units','normal','pos',[0 0 1 1],
...'min',0,'max',100);
set(hs2,'string','DIG_SCOPE');
sys=[0 1 0 1 0 0];
x0= hs2;
elseif abs(flag)==2,
tempstr=get( x(1) , 'string' );
newstr=str2mat( num2str(u),tempstr );
% Keep the last 50 values
[m n]=size(newstr);
if m>50,
newstr=newstr(1:50,:);
end
set( x(1) , 'string', newstr);
sys= x(1);
else
sys=[];
end