MATLAB: How to write an if statement for if a variable is an integer, perform a function.

for loopif statementMATLAB

Please, how do I say this? I want to perform a function if Var(i) is an integer?
for i = 1: 1000
Var(i+1) = Var(i) + 100e-4
if Var(i) % condition for if Var(i) is an integer (whole number). How do I write this?
%Perform a function
end
end

Best Answer

if ~rem(Var(i),1)