function D = createArray(dims, F)
%CREATEARRAY Create a dlarray of a specified size
%   X = createArray(..., 'dlarray')
%   X = createArray(..., Like = T)
%   X = createArray(..., FillValue = F)
%   X = createArray(..., CLASSNAME, FillValue = F)
%   X = createArray(..., Like = T, FillValue = F)
%   X = createArray(..., FillValue = F, Like = T)
%
%   See also CREATEARRAY, DLARRAY.

%   Copyright 2023 The MathWorks, Inc.

% Static build method
if nargin < 2
    % Default to real double zero
    F = 0;
end

% Discard any attributes from F
T = dlarray([]);

D = createArrayLike(T, dims, F);

end
