www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@conrange/setFeatures.m

    function [con, ok] = setFeatures(con, beta)
%SETFEATURES Set the features (parameters) for a local constraint
%
%   [CON, OK] = SETFEATURES(CON, BETA) sets the features (parameters) of the
%   local constraint CON to BETA.
%
%   See also CONRANGE, 
%            CONRANGE/GETFEATURES,
%            CONRANGE/NFEATURES.

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

nf = numel(beta)/2; % nActiveFactors( con );
beta = beta(:).';

con.Center =  beta(1:nf);

% Constraint parameters
halfwidth = beta(nf+1:end);
% lower bound of zero
halfwidth(halfwidth<0)= 0;
con.HalfWidth = halfwidth;
ok = true;