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 个评论

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.
You have files named something like: 'run me.m'? Did they ever work?

请先登录,再进行评论。

 采纳的回答

Jan
Jan 2012-9-14
编辑:Jan 2012-9-14
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.

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Adding custom doc 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by