www.gusucode.com > mbc 工具箱 matlab 源码程序 > mbc/@mbcmodel/@modelinput/modelinput.m

    function inp = modelinput(varargin)
%MODELINPUT mbcmodel.modelinput constructor
%
% Inputs = mbcmodel.modelinput('PropertyName1',value1,'PropertyName2',value2,...);
% Inputs = mbcmodel.modelinput(NUMINPUTS);
% Inputs = mbcmodel.modelinput(INPUTCELLARRAY);
%
% PROPERTIES
%    Range               [min,max]
%    NonlinearTransform  {'','1./x','sqrt(x)','log10(x)','x.^2','log(x)'}
%    Name                String. Signal name from data set. Inputs for a
%                        test plan must be set before selecting data.
%    Symbol              String. Short name for plot labels and for use in CAGE
%    Units               String. Units are overwritten by the data set units when 
%                        a data set is selected for a test plan.
%
% PROPERTY, VALUE pairs. 
%  Inputs = mbcmodel.modelinput('Symbol',{'A','B'},...
%       'Range',{[0 100],[-20 20]});
% Scalar expansion of properties is also supported.
%  Inputs = mbcmodel.modelinput('Symbol',{'A','B'},...
%       'Range',[0 100]);
%
% NUMINPUTS is the number of inputs. Symbols are automatically set to 'X1',
% 'X2',...,'Xn'. The default range is [-1,1].
%   Inputs = mbcmodel.modelinput(2);
% 
% INPUTCELLARRAY is a cell array with one row per input and 5 columns to specify:  
%     1. Symbol (string)
%     2. Minimum (double)
%     3. Maximum (double)
%     4. NonlinearTransform (string) -- empty for none
%     5. Signal name
% These columns are the same as the columns in the "Input Factor Setup" dialog box that
% can be launched from the test plan in the Model Browser.
%    Inputs = mbcmodel.modelinput( {...
%         'N',   800, 5000, '', 'ENGSPEED'
%         'L',   0.1,    1, '', 'LOAD'
%         'EXH',  -5,   50, '', 'EXHCAM'
%         'INT',  -5,   50, '', 'INTCAM'
%        } );
%
%  See also mbcmodel.CreateModel, mbcmodel.project.CreateTestplan

% Copyright 2007 The MathWorks, Inc.

inp = mbcmodel.modelinput;

if nargin==0
    inp.Object = mbcinputfactor;
else
    % make a single input
    % get mbcinputfactor from input arguments
    inp.Object = mbcinputfactor(varargin{:});
end