Functions |
function | sfdrawbitmap (block)%MSFUNTMPL A template for an M-file S-function%The M-file S-function is written as a MATLAB function with the%same name as the S-function.Replace 'msfuntmpl'with the name%of your S-function.%%It should be noted that the M-file S-function is very similar%to Level-2 C-Mex S-functions.You should be able to get more%information for each of the block methods by referring to the%documentation for C-Mex S-functions.%%Copyright 2003-2006 The MathWorks |
function Inc etc Do not add
any other calls to the main
body of the function | setup (block) |
block | SetSimViewingDevice (1) |
block | SetAccelRunOnTLC (false) |
block | RegBlockMethod ('PostPropagationSetup',@DoPostPropSetup) |
block | RegBlockMethod ('ProcessParameters',@ProcessPrms) |
block | RegBlockMethod ('Start',@Start) |
block | RegBlockMethod ('Update',@Update) |
1 | Data () |
if | ~strcmp (class(a), 'double')%error('Invalid parameter') |
end endfunction function | DoPostPropSetup (block) block.NumDworks |
block | Dwork (1).Name = 5 |
block | Dwork (2).Name = 1 |
endfunction function | Start (block) hFig |
| set (hFig, 'Name', 'MCL probability') |
| set (hFig, 'DoubleBuffer', 'on', 'Tag', 'mclProbab') |
| set (fig, 'Renderer', 'painters') |
| set (fig, 'Color', 'black') |
| hold ('on') |
endfunction function | Update (block)%Do not draw bitmap too often last_draw |
| if (block.CurrentTime< last_draw+1/20) = 360 - angle1 |
| set (0,'CurrentFigure', 3)%Make the figure current bitmap |
| image (bitmap) |
| colormap (gray) |
Variables |
function Inc | $Revision |
function Inc | parameters |
endfunction | Function |
block | NumOutputPorts = 0 |
Setup port properties to be
inherited or dynamic block | SetPreCompInpPortInfoToDynamic |
block | AllowSignalsWithMoreThan2D = true |
| fig_axes = get(hFig, 'CurrentAxes') |
| return |