Write a function isint that will receive a number input argument innum, and will return 1 for true if this number is an integer, or 0 for false if not. Use the fact that innum should be equal to int32(innum) if it is an integer
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:3| Question number:29.3
All Answers
total answers (1)
isint.m
function out = isint(innum)
% Returns 1 for true if the argument is an integer
% Format of call: isint(number)
% Returns logical 1 iff number is an integer
out = innum == int32(innum);
end
need an explanation for this answer? contact us directly to get an explanation for this answer