Home > m > gui > gltpda > g_iplot.m

g_iplot

PURPOSE ^

This is the automatic function wrapper

SYNOPSIS ^

function g_iplot(block)

DESCRIPTION ^

             This is the automatic function wrapper
 =================================================================
 ================ level-2 M file S-function ======================
 =================================================================
 To save as standalone variable(s) into global shared workspace the AO(s)
 received as input from the corresponding block, executed in Simulink.

  $Id: g_iplot.m,v 1.1 2008/03/01 13:43:20 nicola Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function g_iplot(block)
0002 
0003 %             This is the automatic function wrapper
0004 % =================================================================
0005 % ================ level-2 M file S-function ======================
0006 % =================================================================
0007 % To save as standalone variable(s) into global shared workspace the AO(s)
0008 % received as input from the corresponding block, executed in Simulink.
0009 %
0010 %  $Id: g_iplot.m,v 1.1 2008/03/01 13:43:20 nicola Exp $
0011 
0012 setup(block);
0013   
0014 %%
0015 function setup(block)
0016 global LTPDAinvar;
0017 
0018   %% Register dialog parameter: none, because they're retrieved directly
0019   %% from the memory. This will prevent the user to modify the parameters
0020   %% outside the proper parameters panel:
0021   block.NumDialogPrms = 0;
0022 
0023   %% Register number of input and output ports
0024   block.NumInputPorts  = 1;
0025   block.NumOutputPorts = 1;
0026 
0027   %% Setup functional port properties to dynamically inherited.
0028   block.SetPreCompInpPortInfoToDynamic;
0029   block.SetPreCompOutPortInfoToDynamic;
0030   
0031   block.InputPort(1).DirectFeedthrough = true;
0032   block.InputPort(1).DatatypeID = 0;
0033   block.InputPort(1).Complexity = 0;
0034 % block.InputPort(1).Dimensions = 2;
0035   block.OutputPort(1).DatatypeID = 0;
0036   block.OutputPort(1).Complexity = 0;
0037 % block.OutputPort(1).Dimensions = 1;
0038   block.SampleTimes = [0 0];
0039   block.SetAccelRunOnTLC(false);
0040  
0041   %% Register methods
0042   block.RegBlockMethod('SetInputPortSamplingMode',@SetInpPortFrameData);
0043   block.RegBlockMethod('SetInputPortDimensions',  @SetInpPortDims);
0044   block.RegBlockMethod('SetOutputPortDimensions', @SetOutPortDims);
0045   block.RegBlockMethod('Outputs',                 @Outputs);
0046   
0047   function SetInpPortFrameData(block, idx, fd)
0048   block.InputPort(1).SamplingMode = fd;
0049   block.OutputPort(1).SamplingMode = fd;
0050 
0051   function SetInpPortDims(block, idx, di)
0052   block.InputPort(idx).Dimensions = di;
0053 
0054   function SetOutPortDims(block, idx, di)
0055   block.OutputPort(idx).Dimensions = di;
0056 
0057 
0058 %%
0059 function Outputs(block)
0060 global LTPDAinvar
0061 
0062 % figure
0063 hold on
0064 switch length(block.InputPort(1).Data)
0065     case 1
0066         iplot(LTPDAinvar{block.InputPort(1).Data});
0067     case 2
0068         iplot(LTPDAinvar{block.InputPort(1).Data(1)},LTPDAinvar{block.InputPort(1).Data(2)});
0069     case 3
0070         iplot(LTPDAinvar{block.InputPort(1).Data(1)},LTPDAinvar{block.InputPort(1).Data(2)},LTPDAinvar{block.InputPort(1).Data(3)});
0071     case 4
0072         iplot(LTPDAinvar{block.InputPort(1).Data(1)},LTPDAinvar{block.InputPort(1).Data(2)},LTPDAinvar{block.InputPort(1).Data(3)},LTPDAinvar{block.InputPort(1).Data(4)});
0073 end
0074 
0075 % %========================================================================
0076 
0077    block.OutputPort(1).Data = block.InputPort(1).Data;
0078 
0079 %endfunction
0080

Generated on Mon 31-Mar-2008 21:41:00 by m2html © 2003