필터 지우기
필터 지우기

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 CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by