function varargout = fminsearch(fcn, x0, varargin)
; %#ok<NOSEM> % Undocumented
%FMINSEARCH Find minimum of unconstrained multivariable function using derivative-free method


%   Copyright 2022 The MathWorks, Inc.

[varargout{1:nargout}] = codistributed.pGatherAndCall(str2func(mfilename), fcn, x0, varargin{:});
% Move back to the workers the first two outputs
varargout{1} = cast(varargout{1}, 'like', x0);
if nargout > 1
    varargout{2} = cast(varargout{2}, 'like', x0);
end
