Assigning a name for a Function

I would like to name my function f_density(T) however matlab will not let me save it as that before I run it. It won't allow me to have parenthesis in the name. WHat can I do to fix this?

回答 (1 件)

Walter Roberson
Walter Roberson 2019 年 9 月 2 日

0 投票

You cannot fix that. MATLAB functions must be stored in .m files whose name without directory and extension is a valid MATLAB identifier, starting with a Latin letter (A through Z or a through z), after which you can have only the latin letters, and the Arabic numerals 0 to 9, and the underscore character. Parenthesis are not permitted as part of the file name of a MATLAB function.
You could, though, save that to f_density.m

カテゴリ

ヘルプ センター および File ExchangeEnvironment and Settings についてさらに検索

タグ

質問済み:

2019 年 9 月 2 日

回答済み:

2019 年 9 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by