在 C# 中从 matlab matfile 导入/读取/加载变量 [英] Import / read / load variables from matlab matfile in C#

查看:40
本文介绍了在 C# 中从 matlab matfile 导入/读取/加载变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一段时间,看看是否有人在 CSharp 中阅读 Matlab mat 文件方面做过任何工作,但似乎什么也没有.

I've been searching for a while to see if anyone has done any work on reading Matlab mat files in CSharp, and it seems that there is nothing out there.

有没有人看到任何解决方案?

Has anybody seen any solutions?

我不能简单地将我的 mat 文件导出为文本,然后将它们读入我的 C# 代码中,因为有相当复杂的结构.

I can't simply export my mat files to text and then read them into my C# code, because there are fairly complex structures.

我不喜欢与 Matlab 交互操作,也不想使用 Python (SciPy 和 loadmat).

I don't like to inter operate with Matlab and I don't want to use Python (SciPy with loadmat) either.

推荐答案

可以尝试的一种选择是提交 CSMatIODavid ZierMathWorks 文件交换.它是 .NET 2.0 的 API,可让您读取 5 级 .mat 文件.

One option to try is the submission CSMatIO by David Zier on the MathWorks File Exchange. It's an API for .NET 2.0 that will allow you to read level 5 .mat files.

如果您必须阅读较新的 .mat 文件格式,您可以先将 .mat 文件加载到 MATLAB 中,然后使用 SAVE 函数的版本选项.

If you have to read newer .mat file formats, you can first load your .mat file into MATLAB and resave it as an older format using the SAVE function's version option.

这篇关于在 C# 中从 matlab matfile 导入/读取/加载变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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