2012b not backwards compatible?

Hi, I've installed 2012b yesterday, and to my big dissapointment, it seems that this version does not admit any more names of m files separated by spaces.
If this is true, then I will have to go over my old files and rename every space to something with an "_", as i used to do 15 years ago with Fortran.
So please tell me this is not true, or if it is, tell me why having to go over all my old programs and change the names is good for me.
Thanks a lot,
Gustavo Wolf

2 Comments

Are you talking about the names of directories, or the names of the .m files themselves? It has been a long time that .m file names were not supposed to have spaces: the .m file names must follow the rules for identifiers.
Sean de Wolski
Sean de Wolski on 14 Sep 2012
Edited: Sean de Wolski on 14 Sep 2012
You have files named something like: 'run me.m'? Did they ever work?

Sign in to comment.

 Accepted Answer

Jan
Jan on 14 Sep 2012
Edited: Jan on 14 Sep 2012
Spaces in names of M-files did never work in Matlab.
delete('temp file.m')
The name of the file should match the name of the first function in the file. Valid function names begin with an alphabetic character, and can contain letters, numbers, or underscores.
Onc could claim that only the function name must be valid, but the file name is allowed to differ. But remember that the file name determines which function is called. And when you have three function files like the following, spaces would make a valid parsing impossible:
fun1.m
fun2.m
fun1 fun2.m
What should happen for this line:
fun1 fun2
?!
PS. I have a MEX-tool to use spaces, control characters and even the empty string as fieldnames of a struct. While dynamic fieldnames work perfectly, e.g. S.(' '), the M-File parser rejects these names in the code and this files: |S. | (a space after the dot). What a pitty.

More Answers (0)

Products

Asked:

on 14 Sep 2012

Community Treasure Hunt

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

Start Hunting!