www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@xregmodel/code.m

    function x=code(m,x,factnum)
%CODE perform coding transformation on model [Min,Max] -> Target
%
% x= code(m,x)
% x= code(m,x,factornum) codes all the values in x using the coding for
% the factor specified.  Several factor numbers may be specified, so long 
% as there are the same number of columns in x.

%  Copyright 2000-2007 The MathWorks, Inc. and Ford Global Technologies, Inc.


if nargin<3
    factnum = 1:size(x,2);
end

 
Inp = m.Inputs;
if iscell(x)
    for j = 1:length(factnum)
        x{j} = code(Inp,x{j},factnum(j));
    end
else
    x = code(Inp,x,factnum);
end