Effacer les filtres
Effacer les filtres

Is there built in function such as iseven,isint and factorial in matlab?

78 vues (au cours des 30 derniers jours)
Anushka
Anushka le 13 Fév 2015
Modifié(e) : Stephen23 le 13 Fév 2015
Is there built in functions in matlab such as iseven,isint and factorial in matlab? Can any one please help?

Réponse acceptée

Stephen23
Stephen23 le 13 Fév 2015
Modifié(e) : Stephen23 le 13 Fév 2015
Factorial exists:
factorial(N)
But for the others use some basic code:
mod(N,2)==0 % iseven
mod(N,2)==1 % isodd
fix(N)==N % isint
Tip: learn to navigate the MATLAB documentation using the Contents (on the left-hand side of the webpage). There you can browse and find many related functions and lots of useful information. Try it! Open the page for factorial , and you can see the contents also lists similar functions: gcd, factor, lcm, etc.

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by