%% $RCSfile: sdspeye.tlc,v $ %% $Revision: 1.2 $ %% $Date: 1999/10/26 21:20:00 $ %% %% Copyright (c) 1995-1999 The MathWorks, Inc. All Rights Reserved. %% %% Abstract: Identity matrix %implements sdspeye "C" %% Function: Start ========================================================== %% %function Start(block, system) Output /* DSP Blockset Identity Matrix(%) - % */ %assign OUTPORT = 0 %assign width = CAST("Number",LibDataOutputPortWidth(OUTPORT)) %assign dims = LibBlockOutputSignalDimensions(0) %assign N = MIN(dims[0],dims[1]) %assign numRowsPlusOne = dims[0] + 1 %% %if N == 1 % = 1.0; %else { real_T *y = (real_T *)(%); int_T i; /* Initialize all values to zero */ memset((void *)y, 0, %*sizeof(real_T)); /* Fill in 1's */ for (i=0; i < %; i++) { *y = 1.0; y += %; } } %endif %endfunction %% Start %% [EOF] sdspeye.tlc