我想用 C 语言阅读它的原因是:
我想创建一个 mnrfit.c 文件/函数来替换 mnrfit.m
要查看“smoking.mat”,它位于Matlab的安装目录下:
C:\Program Files\MATLAB\R2013a\help\toolbox\stats\examples"
如果可能的话,请告诉我如何加载名为“吸烟”的数据集(我已经搜索了很多,但找不到方法)?
一旦,我能够在C中读取/加载smoking.mat。我会将数据集保存在链接列表中(自己制作)
最佳答案
有一个 C/C++ 库:
mat.h
这里有它的所有操作。 (包括打开/加载功能)
#include <mat.h>
matClose (C and Fortran) Close MAT-file
matDeleteVariable (C and Fortran) Delete named mxArray from MAT-file
MATFile (C and Fortran) Type for a MAT-file
matGetDir (C and Fortran) Get directory of mxArrays in MAT-file
matGetFp (C) Get file pointer to MAT-file
matGetNextVariable (C and Fortran) Read next mxArray from MAT-file
matGetNextVariableInfo (C and Fortran) Load array header information only
matGetVariable (C and Fortran) Read mxArray from MAT-files
matGetVariableInfo (C and Fortran) Load array header information only
matOpen (C and Fortran) Open MAT-file
matPutVariable (C and Fortran) Write mxArrays to MAT-files
matPutVariableAsGlobal (C and Fortran)
This blog contains good info: Matlab C Library Mat File Operations
关于我们可以用C语言读取smoking.mat(数据集)吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28790620/