How I can remove the decimal part in matlab?

15 vues (au cours des 30 derniers jours)
Ameligege
Ameligege le 12 Fév 2015
Commenté : Ameligege le 13 Fév 2015
in the division operation i want only the real part without the decimal part? like 4.56 I want only 4 how can i do that?

Réponse acceptée

Image Analyst
Image Analyst le 12 Fév 2015
Look up the help for round(), floor(), ceil(), and fix(). Those all do that and leave the number as a double. If you want an integer data type, you can use uint8(), uint32(), int32(), uint16(), and int32(). These also chop off the fraction and round, but give you an integer data type instead of a floating point data type.

Plus de réponses (1)

Eduardo Márquez
Eduardo Márquez le 12 Fév 2015
Modifié(e) : Eduardo Márquez le 12 Fév 2015

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by