function [str, errmsg] = sprintf(varargin)
%SPRINTF Write formatted data to string or character vector
%   SPRINTF operates on any combination of dlarrays and standard MATLAB
%   arrays by extracting data from the dlarrays and then invoking the
%   standard SPRINTF function. All valid syntaxes for SPRINTF are
%   supported.
%   
%   See also SPRINTF, DLARRAY.

%   Copyright 2019 The MathWorks, Inc.

% Call extractdata on all the input arguments and pass the call on
varargin = extractDlarrayCell(varargin);

if nargout>1
    [str, errmsg] = sprintf(varargin{:});
else
    str = sprintf(varargin{:});
end
