フィルターのクリア

vv with long names

2 ビュー (過去 30 日間)
jose herrero
jose herrero 2017 年 10 月 9 日
コメント済み: Steven Lord 2017 年 10 月 9 日
Hey, got installed the 2016b version on mac and it seems to not like programmes with long names: when i try to run this code directly step1_preproccessing_CL_TDT-170920-112847
gives me this error: Undefined function or variable 'step1_preproccessing_CL_TDT'.
if I change the name to shorter one (e.g.,step1_CCEPs_Pre) it runs ok but it's no good for me as i wanna call my code as above.

採用された回答

Guillaume
Guillaume 2017 年 10 月 9 日
Matlab only uses the first namelengthmax characters of any identifiers. This has been fixed to 64 characters since forever and there's been no indication that it's about to change.
There is no workaround, you will have to use shorter names. Embedding metadata in filenames is not a good idea anyway. Embed that metadata with your data instead.
  1 件のコメント
Steven Lord
Steven Lord 2017 年 10 月 9 日
namelengthmax is currently 63 characters and has been at 63 characters. The limit on the maximum identifier length was increased from 31 to 63 at the same time the namelengthmax function was introduced, both in MATLAB 6.5 (release R13.) See the Release Notes for that release for more information. Note that viewing this old documentation may require logging in to your MathWorks account.

サインインしてコメントする。

その他の回答 (1 件)

Steven Lord
Steven Lord 2017 年 10 月 9 日
In this case the problem is not with the length of the name but with the characters it contains. The names of functions in MATLAB must start with a letter, must be no longer than namelengthmax characters, must not be the same as a keyword (with the exception of an overloaded end method), and must contain only letters, numbers, and the underscore character.
The name step1_preproccessing_CL_TDT-170920-112847 satisfies three of those four requirements. It fails the last; the character '-' is not allowed in function or variable names.

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by