如何从slx文件中获取元数据使用C#或C ++? [英] How can l get metadata from slx file use C# or C++?

查看:275
本文介绍了如何从slx文件中获取元数据使用C#或C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的MATLAB APP中,我使用下一代码来设置我的自定义元数据。

In my MATLAB APP I use next code for set my custom metadata.

h = load_system(pathToFile);
set_param(h, 'Metadata', properties)



我还有C#项目可以使用Matlab文件,我需要从slx文件中获取元数据。另外我知道.slx文件有zip格式,所以我能够发现我的数据被写入.mxarray文件。



请给我举个例子如何从sxl文件获取数据或使用C#或C ++读取.mxarray文件。



我尝试过:




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.

推荐答案

我还没有真正使用过MATLAB,但看起来它提供了一个匹配方法 get_param 来检索参数值,请参阅:



获取参数名称和值 - MATLAB get_param [ ^ ]



似乎它也将API暴露给C ++。请参阅:



用于C ++的MATLAB API - MATLAB &安培; Simulink [ ^ ]



虽然,看起来你可能会问一个不同的问题。如果您在没有API的情况下询问如何访问此信息,这将非常困难。文件格式是专有的,没有文档,显然可能会有变化。



从ZIP访问未压缩文件非常简单。简单来说,请查看以下内容:



如何:压缩和提取文件| Microsoft Docs [ ^ ]



关于文件格式,以及在何处查找元数据,您主要依靠自己。您必须对格式进行反向工程。这并不简单。如果你坚持这样做,这可能会让你开始,但我怀疑它已经过时了:



Matlab的内部存储器表示未记载的Matlab [ ^ ]



正如我所说,我对MATLAB不是很熟悉,所以也许其他人会为你提供更快乐的消息。
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.


这篇关于如何从slx文件中获取元数据使用C#或C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆