function res = squarerootV5(mat)
res = zeros(size(mat)); %! The output has the same shape as the input
for k=1:prod(size(mat)) %! note the \code{(:)} 
   res(k) = squarerootV2( mat(k) ); %! Single-number indexing
end
