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

    function des = setdatapoint(des, idx, isdata)
%SETDATAPOINT Mark design points as taken data
%
%  DES = SETDATAPOINT(DES, IDX) marks the design points indicated by the
%  index IDX as being "data points".  This means that the data has been
%  taken and the points should not be edited or removed.  Data points
%  contribute to the list of fixed points returned by the methods FIXPOINTS
%  and FREEPOINTS, but cannot be unfixed using the user-fixed points
%  interface.
%  IDX can be either a vector of design point indices or a logical vector
%  the same length as the design.
%
%  OUT = SETDATAPOINT(DES, IDX, ISDATA) specifies whether the indicated
%  points should be marked (ISDATA=true) or unmarked (ISDATA=false). 

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


if nargin<3
    if islogical(idx)
        % Set the 1:Nth points to have these states
        isdata = idx;
        idx = 1:length(idx);
    else
        % Set the specified points to be flagged as true
        isdata = true;
    end
end

flags = pGetFlags(des, 'DATA');
flags(idx) = isdata;
des = pSetFlags(des, 'DATA', flags);