%% File : sfun_polyval.tlc generated from sfun_polyval.ttlc revsion 1.2 %% $Date: 2000/03/02 22:39:26 $ %% %% Rob Aberg, 11-Aug-1999 %% Copyright 1990-2000 The MathWorks, Inc. %% %% Abstract: Polynomial evaluation block target file %implements sfun_polyval "Ada" %% Function: Outputs ========================================================== %% Abstract: %% Use Horner's Method to evaluate a polynomial in one variable. %% %function Outputs(block, system) Output -- Polynomial Evaluation (polyval) Block: % %assign rollVars = ["U", "Y"] %roll idx = RollRegions, lcv = RollThreshold, block, "Roller", rollVars %assign u = LibBlockInputSignal( 0, "", lcv, "%%") %assign y = LibBlockOutputSignal(0, "", lcv, "%%") %assign c0 = LibBlockParameter(coefs, "0", "", "") %assign bufferOverWrite = (LibBlockInputSignalBufferDstPort(0) == 0) % := %; %assign rc = LibBlockParameterSize(coefs) %if (rc[0]*rc[1]) > 1 %assign crollVars = ["P"] %roll cidx = [1:%], clcv = RollThreshold, block, ... "Roller", crollVars %assign c = LibBlockParameter(coefs, "", clcv, "%%") % := %*% + %; %endroll %endif %endroll %endfunction