www.gusucode.com > mbctools 工具箱 matlab 源码程序 > mbctools/+mbcmodelview/@OutlierLine/isLineHandle.m

    function out = isLineHandle(obj, inputH, dataSize)
% OUT = ISLINEHANDLE(LINES, DATALENGTH)
% 
% LINES is a vector of candidate line handles
% OUT is a vector of all elements of LINES that are handles of line objects
% optional second argument:
% with data the same length as DATALENGTH
% if none qualify, empty array is returned

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

if nargin<3
    dataSize = obj.DataSize;
end

if  any(isgraphics(inputH,'line'))
	lineH = inputH(isgraphics(inputH,'line'));
    if dataSize==0 && ~isempty(lineH)
        % use size of data
        dataSize = length(get(lineH(1),'XData'));
    end
    
	% check length of line data consistent
    if length(lineH) > 1
        out = lineH(cellfun('length',get(lineH,'XData'))==dataSize);
    elseif length(lineH) == 1 
        out = lineH(length(get(lineH,'XData'))==dataSize);
    else
        out = lineH;
    end
else
    out = [];
end