how to make matlab support capital letters .MAT file format

3 Ansichten (letzte 30 Tage)
Pascal
Pascal am 8 Okt. 2013
Bearbeitet: Jan am 8 Okt. 2013
I'm on mac os lion, I have .MAT files needed to process with matlab, but cannot load and i have to change the extension all the time to .mat file extension. is there a way to set matlab to also handle the capital letters .MAT file extension. PS, I have more than 200 files every time for changing extension.
  2 Kommentare
dpb
dpb am 8 Okt. 2013
Why not quit making inconsistently-named files instead?
Show your code -- altho I don't have a system to test on, I'd presume if you match case in the filename given load that should pass through ok...
Or, if you can't implement solution 1) and you're going to be stuck with this going forward and can't just do a global rename on the OS shell side to the lowercase version of the extension, write a function that does the rename internally before it calls load. But, this would be last choice of preference.
Cedric
Cedric am 8 Okt. 2013
If you inherited these files and have no control over how they are/were named, you can build a small script which renames all files with lower case extension.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jan
Jan am 8 Okt. 2013
Bearbeitet: Jan am 8 Okt. 2013
I cannot test it, but this should work:
Data = load('FileName.MAT', '-MAT');
If this can import files with any extension assuming they have MAT format, why shouldn't this work for '.MAT' also?
Anyway, I'd prefer a clean naming scheme instead. But I had some '.MAT' files also on an old ISO9660 CD, such that renaming would require a copy to the hard disk at first.

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by