How do I write an if statement for if a variable is an integer, perform a function.
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Temi O
el 27 de Feb. de 2019
Comentada: Temi O
el 1 de Mzo. de 2019
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
0 comentarios
Respuesta aceptada
madhan ravi
el 27 de Feb. de 2019
Editada: madhan ravi
el 27 de Feb. de 2019
if ~rem(Var(i),1)
5 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!