MATLAB Answers

Aditya Jain
0

Standards for a function name

Aditya Jain
さんによって質問されました 2016 年 8 月 25 日
最新アクティビティ Aditya Jain
さんによって コメントされました 2016 年 8 月 25 日
MATLAB has a standard that a variable can only consist of digits, letters and underscores
Is there any standard for function names?

  3 件のコメント

"MATLAB has a standard that a variable can only consist of digits, letters and underscores" What are those standards?
Adam
on 25 Aug 2016
I would assume that the same constraints on variable naming also apply to function naming.
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

サインイン to comment.

タグ

1 件の回答

John D'Errico
Answer by John D'Errico
on 25 Aug 2016
 Accepted Answer

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 件のコメント

Thanks.

サインイン to comment.



Translated by