Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my MATLAB APP I use next code for set my custom metadata.
Matlab
h = load_system(pathToFile);
set_param(h, 'Metadata', properties)

Also I have C# project which work with Matlab files and I need to get metadata from slx files. Also I know that .slx file has a zip format, so I was able to find out that my data is written to the .mxarray file.

Please give me example how can I get my data from sxl file or read .mxarray file with use C# or C++.

What I have tried:

I tried read .slx and .mxarray files but I don't know how do this correctly.
Posted
Updated 20-Jul-18 5:53am

1 solution

I haven't really played with MATLAB, but it looks like it provides a matching method get_param for retrieving parameter values, see:

Get parameter names and values - MATLAB get_param[^]

It seems it also exposes that API to C++. See:

MATLAB API for C++- MATLAB & Simulink[^]

Though, it seems maybe you are asking a different question. If you are asking how to access this information without the API, this will be very difficult. The file format is proprietary, undocumented, and apparently subject to change.

Accessing an uncompressed file, from a ZIP, is fairly straightforward. Simply, check out the following:

How to: Compress and extract files | Microsoft Docs[^]

As to the file format, and where to find the meta-data, you're largely on your own. You'd have to reverse engineer the format. This is nothing simple. If you insist on going that way, this might get you started, but I suspect its fairly out-of-date:

Matlab’s internal memory representation | Undocumented Matlab[^]

As I said, I'm not very familiar with MATLAB, so maybe someone else will have happier news for you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900