Standards for a function name

35 vues (au cours des 30 derniers jours)
Aditya Jain
Aditya Jain le 25 Août 2016
Commenté : Aditya Jain le 25 Août 2016
MATLAB has a standard that a variable can only consist of digits, letters and underscores
Is there any standard for function names?
  3 commentaires
Adam
Adam le 25 Août 2016
I would assume that the same constraints on variable naming also apply to function naming.
Aditya Jain
Aditya Jain le 25 Août 2016
When i say standards, i mean restriction.
A valid variable name is a vector of characters, digits and underscores.
What i meant to ask is, what could be conditions where a function name is invalid

Connectez-vous pour commenter.

Réponse acceptée

John D'Errico
John D'Errico le 25 Août 2016
Why not read the help for functions? Surely the place to look. under
doc function
I immediately saw this line near the very top:
"Valid function names begin with an alphabetic character, and can contain letters, numbers, or underscores."
In addition, it is a terribly poor idea to use names for functions that are already in use. So calling your new function ones or zeros, or sum, is a really bad idea.
  1 commentaire
Aditya Jain
Aditya Jain le 25 Août 2016
Thanks.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by