%% $Revision: 1.1.6.4 $
%% 
%%
%% Murali Yeddanapudi, 02-Sep-1997
%% Copyright 1994-2004 The MathWorks, Inc.
%%
%% Abstract: Merge block target file.

%implements Merge "C"

%% Function: BlockInstanceSetup ==============================================
%% Abstract:
%%   Set expression folding compliance
%%
%function BlockInstanceSetup(block, system) void
  %<LibBlockSetCustomStorageComplianceLevel(block, 2)>
  %<LibBlockSetIsExpressionCompliant(block)>
%endfunction


%% Function: Start ============================================================
%% Abstract:
%%      Output = IC
%%
%function Start(block, system) Output
  %assign initOutLen = SIZE(InitialOutput.Value,1)
  %if initOutLen != 0 && (!ISEQUAL(block.TID, "constant") || ...
    ISFIELD(block, "NeedOutputsFcnInMdlStart"))
    
    /* %<Type> Block: %<Name> */
    %assign rollVars   = ["P", "Y"]
    %assign rollRegion = [0:%<LibBlockOutputSignalWidth(0)-1>]
    %roll idx = rollRegion, lcv = RollThreshold, block, "Roller", rollVars
      %assign realIdx = "%<tRealPart>%<idx>"
      %assign rhs = LibBlockParameter(InitialOutput,"",lcv,realIdx)
      %<LibBlockAssignOutputSignal(0,"",lcv,realIdx,rhs)>;
      %if LibBlockOutputSignalIsComplex(0)
        %assign imagIdx = "%<tImagPart>%<idx>"
        %if LibBlockParameterIsComplex(InitialOutput)
          %assign rhs = LibBlockParameter(InitialOutput,"",lcv,imagIdx)
        %else
          %assign rhs = SLibGetFormattedValue(InitialOutput,0)
        %endif
	%<LibBlockAssignOutputSignal(0,"",lcv,imagIdx,rhs)>;
      %endif
    %endroll

  %endif
%endfunction %% Start


%% EOF: merge.tlc
