How to make Matlab case insensitive when calling mfiles

I have used Matlab for years and just updated to R2014a. I have m-file tool boxes that have been created over the years; many of the m-files have names with uppercase letters. How can I have Matlab ignor case when calling an m-file? Changing all the mfile names to lowercase will be a huge task! Changing all the mfile calls in other mfiles would be an even bigger task!
Help!

 Accepted Answer

You can't.
It has been mentioned in the docs of at least R2008b, that Matlab will become case-sensitive as it was under Linux all the time.
I'm using a tool to identify all case conflicts. Unfortunately it uses many other of my other tools, such that a publication in the FEX is too time-consuming. But the strategy is easy:
  • Collect the names of all M-files by stepping through all folders of the PATH
  • Open each file
  • Remove the comments
  • Identify the symbols in each line (SYMVAR does not find "f" in the term "f(x)", so you need another tool from the file exchange instead).
  • If the case does not match, display a message. I show a hyper-link, which calls opentoline to let the user open the M-file in the corresponding line directly.
Good luck!
Afterwards your code is cleaner, compatible with other Matlab versions, runs under Mac and Linux and most likely you find some bugs.

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Asked:

on 19 Aug 2014

Answered:

Jan
on 19 Aug 2014

Community Treasure Hunt

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

Start Hunting!