Fighting case sensitivity in Win7 / Matlab R1011b

Maybe somebody here can tell me if I am doing something fundamentally wrong or whether I'm dealing with a new issue. I recently upgraded to Matlab R1011b under Windows 7. I need to install a supplementary command set, which to my knowledge has worked with past versions of Matlab through R1011a, also with Windows 7. These supplementary commands are installed in a separate folder with path
C:\Program Files (x86)\XXXX\MATLAB
To make these files accessible, a STARTUP.M file is set up in the Matlab folder at \toolbox\local\STARTUP.M. When it starts, MATLAB appears to find this scripts and execute it successfully, and displaying PATH shows that the additional path line is present at the front of the PATH environment. Everything looks right, with no cases inconsistency. There are a number of commands implemented in the supplementary folder as *.mex86 commands with names in lower-case, and with corresponding *.M scripts with names in upper case providing command line help... these all seem to be found and run correctly. The command that I want to execute is not one of these -- it is a pure M-file script in the same folder. An example is a script called INIT.M (name not my fault!). The command 'help INIT' (or 'help init') finds this script and displays the dcumentation lines.
The installations are done as administrator, with the software executed under a user account. When I attempt to execute this script...
>> INIT
I get back a diagnostic
"Cannot find an exact (case-sensitive) match for 'INIT'. Do you want INIT (in C:\Program Files\XXXX\MATLAB\INIT.M)?"
D*** right I do. Typing the command as lower case 'init' makes no difference.
Any ideas? Am I overlooking something obvious? something 'Windows'?

1 Comment

I think using different case for the compiled files and M-files is confusing. Matlab prefers the compiled files, but this distinction might fail, if there are additional differences in the case.

Sign in to comment.

 Accepted Answer

*.mex86 commands? Do you mean *.mexw32?
Does a lowercase file extension *.m help?
The commands are in "C:\Program Files (x86)\XXXX\MATLAB", but Matlab suggests using "C:\Program Files\XXXX\MATLAB\INIT.M"? This is a different folder.
Do you have several INIT files? Please try "which INIT -all" and "which init -all".

1 Comment

Yes, you have caught me incorrectly copying from my badly scribbled notes... The compiled files actually are *.mexw32. (Not my main consideration, since they work.) MATLAB actually suggested the 'Program Files (x86)' folder, which is what it seems to use for everything in this 32-bit version. Windows overrides the file name, appending a .M and leaving me with INIT.m.M if I attempt to set up a file name with mixed case, and that of course is not helpful. A lowercase init.m name, no difference. I have only one INIT file... but HELP message reports that there are two other overloaded paths like /tscollection/init and /timerseries/init (these might not be exactly right given my lousy notes). These apparently were not found or used either.

Sign in to comment.

More Answers (2)

You could try
warning('off','MATLAB:dispatcher:InexactMatch')
but I do not know if that would help in this situation.

2 Comments

I do like the new case-sensitivity under Windows. I'm using functions names with CamelCase, if the functions can be accessed from anywhere and sulkingCamelCase for functions, which should be used locally only (e.g. private functions). Together with Matlab's lowercase syntax, I have a certain protection for not using built-in functions by accident. E.g. there was no "beep" command in ancient Matlab versions. If I edit one of my very old M-files and find "Beep('off')" I know, that I meant my own beeping function.
With disabled IndexactMatch corresponding errors are harder to find, if possible at all.
In consequence I would not try to _fight_ the case-sensitivity as the OP said in the subject, but to learn to _use_ it.
Interesting idea... no apparent benefit. Apparently, being unable to locate a command is 'error' rather than 'warning'. I'm with you on this, I much prefer to figure out what MATLAB wants and live within that, rather than forcing users to apply overrides.

Sign in to comment.

Here is some new information that 'local experts' will probably find helpful...
It appears that Jan was on the right track. I copied the contents of the original INIT.M file that Matlab couldn't find any more... saving the contents under new names. Windows apparently did not mess with the file type extensions when writing a new file as it would if I attempted to change the name of an existing file with Windows Explorer. This let me test a mix of case: "TRYIT.m, whynot.M, lookee.m"
These were saved in the same folder with the original INIT.M file. Lo and behold... MATLAB could find and successfully execute the scripts that had the .m file extensions, but not the .M extensions. (Though it could find them all via the HELP command...)
This might be considered a 'new feature', but not playing nice with Windows, and breaking existing applications that worked with the previous minor release, seems a little "buggy" to me. Other opionions on this?

Categories

Products

Asked:

on 15 Sep 2011

Community Treasure Hunt

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

Start Hunting!