What does it mean "/Multiple" after variable name in *.mat file?

I have *.mat files exported by Bruker Opus program. When I select these files Matlab lists the variables contained in that file. However, after each variable name there is a /Multiple note, (see figure).
When I click on the file it does not load anything.
What does it mean the "/Multiple"? How to load these files?

 採用された回答

James Tursa
James Tursa 2024 年 4 月 25 日
編集済み: James Tursa 2024 年 4 月 25 日

1 投票

If the file is written by a 3rd party tool, it is probably written in uncompressed format. In that case, and if the /Multiple is actually part of the variable names, maybe you can just open the file in a text editor and do a global replace of "/Multiple" with "_Multiple". Save the file under the same name, and then try loading that. It is critical that the number of characters you are replacing remains exactly the same before and after. I.e., don't replace "/Multiple" with "Multiple" because the number of characters are not the same. I think mat files record the length of variable names and you don't want to muck that up.

3 件のコメント

Walter Roberson
Walter Roberson 2024 年 4 月 25 日
(I would save the file under a different name, just-in-case)
James Tursa
James Tursa 2024 年 4 月 25 日
@Walter Roberson Yes of course!
Csaba
Csaba 2024 年 4 月 26 日
Thanks, it worked, although I edited it in a Hex editor.
Csaba

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2024 年 4 月 22 日

0 投票

The .mat file has been created by an external program not using the official Application Programming Interface. The variable names that have been inserted in the .mat are not valid.

9 件のコメント

Csaba
Csaba 2024 年 4 月 22 日
編集済み: Csaba 2024 年 4 月 22 日
Well, I downloaded the file. When running it it says:
"Error using loadfixnames (line 136)
Unable to compile loadfixnames.c"
Since I do not have any C compiler (long time ago I stopped writing C programs), I checked the description, it says:
"Requires
Any C compiler, such as the supplied LCC compiler. The routines are self-building ... you don't have to know anything about mex or C to use them."
But there is no supplied compiler in the zip file downloaded. I am still using the 2019b version, where in principle it should be.
I have installed the MINGW compiler suggested by MATLAB. When I try to run loadfixnames the MATLAB crashes.
Any suggestions?
James Tursa
James Tursa 2024 年 4 月 23 日
編集済み: James Tursa 2024 年 4 月 23 日
I think loadfixnames is broken in the latest versions of MATLAB because TMW changed the API to disallow loading invalid named variables in mex routines, so the mex routine can't fix them. I will take another look at this submission to see if there is any way to bring it up to date.
Are the mat files text files? I.e., can you read them in a text editor? Can you post one of the mat files?
Csaba
Csaba 2024 年 4 月 23 日
No, these files are binary.
I do not know how to attach, because the smallest one is bigger than 10 Mb and cannot be attached here.
James Tursa
James Tursa 2024 年 4 月 23 日
Can you try to reproduce the problem with a smaller file? I.e., generate a new smaller file?
Csaba
Csaba 2024 年 4 月 23 日
Unfortunately this is the smallest file the instrument can produce. It is a map of a FT-IR microscope and this is the smallest area to be scanned.
James Tursa
James Tursa 2024 年 4 月 23 日
編集済み: James Tursa 2024 年 4 月 23 日
OK. Did you try running with the verbose flag set to 1? What output did you see before MATLAB crashes?
Csaba
Csaba 2024 年 4 月 24 日
loadfixnames('map 2x2 32x32 m5.0.mat',1)
Verbose ...
Invalid Name: <AB/Multiple>
Replaced With: <AB_Multiple>
Loading variable <AB_Multiple> double 553 x 4097
James Tursa
James Tursa 2024 年 4 月 24 日
Interesting ... loadfixnames sees that /Multiple as part of the variable name. And the dimensions differ from your post. I will try to look into my code this weekend.
Csaba
Csaba 2024 年 4 月 25 日
Dimensions differ because unfortunately I tried a different file. Sorry. Here is the file content:

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeWorkspace Variables and MAT Files についてさらに検索

製品

リリース

R2019b

質問済み:

2024 年 4 月 22 日

コメント済み:

2024 年 4 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by