Borrar filtros
Borrar filtros

vv with long names

2 visualizaciones (últimos 30 días)
jose herrero
jose herrero el 9 de Oct. de 2017
Comentada: Steven Lord el 9 de Oct. de 2017
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.

Respuesta aceptada

Guillaume
Guillaume el 9 de Oct. de 2017
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 comentario
Steven Lord
Steven Lord el 9 de Oct. de 2017
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.

Iniciar sesión para comentar.

Más respuestas (1)

Steven Lord
Steven Lord el 9 de Oct. de 2017
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.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by