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

    function con = pMapToNaturalUnits(con, m)
%PMAPTONATURALUNITS Map a constraint defined in coded units to one defined
%in natural units
%
%   CON = PMAPTONATURALUNITS(CON, FRIEND)

%   Copyright 2005-2014 The MathWorks, Inc.

% Adjust the Center and HalfWidth to take account of the change in coding
%  -- The INVCODE method of the model can map the min and max values from
%     coded units to natural units.
bounds = [...
    con.Center - con.HalfWidth
    con.Center + con.HalfWidth
    ];
bounds = invcode( m, bounds, getActiveIndices( con ) );
con.Center    = (bounds(2,:) + bounds(1,:))/2;
con.HalfWidth = (bounds(2,:) - bounds(1,:))/2;