How to determine whether input is integer

The easiest and fastest way to check if a variable is an integer independently of its format is to compare the input with its rounded version, for example:


If we are just interested in knowing if the input is an integer matlab variable (sint or uint) we can use isainteger Matlab function.

La forma más fácil y rápida para comprobar si una variable es un número entero independientemente de su formato es comparar la entrada con su versión redondeada, por ejemplo:


Si solo estamos interesados en saber si la entrada es una variable en formato entero de matlab (sint o uint) podemos utilizar la función isainteger de Matlab.

This entry was posted in Sin categoría and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s