gusucode.com > bigdata 工具箱 matlab源码程序 > bigdata/+matlab/+bigdata/+internal/+lazyeval/callFunctionHandle.m

    %callFunctionHandle
% Helper function that calls a function handle in the presence of
% explicitly broadcasted arrays.
%
% The lazy evaluation framework will ensure that explicitly broadcasted
% arrays are placed in a 1 x 1 BroadcastArray instance containing the
% entire array that is broadcasted to all partitions. As per the singleton
% dimension rules, this function handle will receive the BroadcastArray
% instance on all function calls so it simply unwraps such instances.
%

% Copyright 2016 The MathWorks, Inc.

function varargout = callFunctionHandle(handle, varargin)

for ii = 1:numel(varargin)
    if isa(varargin{ii}, 'matlab.bigdata.internal.BroadcastArray')
        varargin{ii} = varargin{ii}.Value;
    end
end

[varargout{1:nargout}] = feval(handle, varargin{:});