www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgoptimrunner/getRunSubset.m

    function obj = getRunSubset(obj, idx)
%GETRUNSUBSET Get a subset of the run data
%
%  OBJ = GETRUNSUBSET(OBJ, IDX) returns an object that contains just the
%  fixed and initial data for the specified runs and is set to run all of
%  those runs.

%  Copyright 2005 The MathWorks, Inc. and Ford Global Technologies, Inc.


if all(idx>0 & idx<=size(obj.InputData{1}, 1))
    for n = 1:length(obj.InputData)
        obj.InputData{n} = obj.InputData{n}(idx,:);
    end
    obj.RunIndices = 1:length(idx);
else
    error(message('mbc:cgoptimrunner:InvalidIndex'));
end