MATLAB: Is there something wrong with this function

function

It is supposed to figure out if the number is whole or not. if not it rounds down, if it is it squares.
function [remainder]=data_modifier(data1)
remainder=rem(data1,1)
if remainder==0
sqrt(data1)
else
floor(data1)
end
end

Best Answer

function [result]=data_modifier(data1)
if isfloat(data1)==1
sqrt(data1)
else
floor(data1)
end
end