%% Specify Data Type of NaN Values
% Create a 1-by-3 vector of NaN values whose elements are of type single.

X = NaN(1,3,'single')

% You can also specify the output type based on the type of another variable. Create a variable p of type single. Then, create a vector of NaN values with the same size and type as p.

p = single([1 2 3]);
X = NaN(size(p),'like',p)

% Copyright 2018 The MathWorks, Inc.