www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@calibrationdata/@calibration/pAxisHasDependents.m

    function flag = pAxisHasDependents(obj, axisIdentifier)
%PAXISHASDEPENDENTS  Private method.

%  PAXISHASDEPENDENTS(CAL,IDENTIFIER) returns true if an axis with
%  identifier IDENTIFIER has dependent curves, maps, etc.

%  Copyright 2004-2007 The MathWorks, Inc.


% Handle cell arrays
if iscell(axisIdentifier)
    flag = true(size(axisIdentifier)); % preallocate
    for c = 1:numel(axisIdentifier),
        flag(c) = obj.pAxisHasDependents(axisIdentifier{c});
    end
    return
end

% Check that axis exists
axis = getAxis(obj, axisIdentifier);

% Check curves
for c = 1:numel(obj.Curves),
    if strcmp(axisIdentifier, obj.Curves(c).XAxisIdentifier)
        flag = true;
        return
    end
end

% Check maps
for c = 1:numel(obj.Maps),
    if strcmp(axisIdentifier, obj.Maps(c).XAxisIdentifier)
        flag = true;
        return
    elseif strcmp(axisIdentifier, obj.Maps(c).YAxisIdentifier)
        flag = true;
        return
    end
end

flag = false;