Questions tagged [matio]

A C library for reading and writing Matlab MAT files.

Matio is an C library for reading and writing Matlab MAT files. It supports file version 4, 6 and 7.3 (HDF). For further references, see the sourceforge site.

15 questions
2
votes
2 answers

Lua: Read userdata as number / Compare userdata with number

I am trying to import numbers from files and change them if they are at a certain value. I am using torch to get values form gesture and change them from 101 to 10 or from 100 to 9 if the input is the corresponding number (10 or 9). Unfortunately, I…
DaveTheAl
  • 1,995
  • 4
  • 35
  • 65
1
vote
0 answers

Load .fig figure form Matlab in python. Error bars make figure look weird

I got a .fig file generated in Matlab and I would like to display it in python environment, or at least retrieve the data. It works well when the original figure does not contain error bars. But when I have error bars then it looks like a staircase.…
Jokerp
  • 213
  • 1
  • 9
1
vote
1 answer

Opening a 3d matlab file in C++ with Matio

So I have a matlab file that is a 3d matrix. I am using C++ to read in the file, specifically with matio.h but I am having some trouble/confusion with reading the actual data. I know how to find out how many dimensions, rank, and name of the data,…
M.Lanus
  • 11
  • 2
1
vote
1 answer

Mat_Open is not working while using matio in C++

I am using the matio library to write the contents of a std::vector>> and some other data to a MatLab file. I used a tutorial here: http://na-wiki.csc.kth.se/mediawiki/index.php/MatIO However, Mat_Open stays NULL,…
rbnvrw
  • 347
  • 3
  • 15
1
vote
1 answer

Statically linking matio library using g++

How do you statically link matio, a library for reading mat-files, mainly used by matlab and octave into an executable? If the file main.cpp holds matio functionality the compiler call g++ -o main main.cpp -Imatio/include matio/lib/libmatio.a fails…
Woltan
  • 13,723
  • 15
  • 78
  • 104
0
votes
1 answer

Linking in HDF5 to project using Matio fails

I am working on a QT 5 project and doing my development under MSYS2/Mingw64. Within that project is a sub-project using Matio, which is compiled into a static .a library. Matio, with the macros HAVE_HDF5 and MAT73 set to true (1) can support the…
Tyler Shellberg
  • 1,086
  • 11
  • 28
0
votes
1 answer

MATIO read complex data

Im trying to convert a program from C++/MEX to just C++ using MATIO and I am wondering if MATIO has an equivalent to mxGetPr(cal) and mxGetPi(cal)? I see in the struct typedef struct matvar_t it has void *data filed Here is how to write a complex…
Tyler
  • 13
  • 5
0
votes
1 answer

How can I load struct fields from Matlab to C++?

So I have a struct called stf with multiple fields; each field is a vector. I tried using the Matio library to get reach for those variables, but all I get is one variable, namely the struct stf. As the stf struct has 4 fields, I get 4 double…
Bializm
  • 1
  • 4
0
votes
0 answers

Error when linking C shared library libmatio.dll

so I have built and installed the MATIO library before, but without HDF5 and now I want to use it with HDF5 as I wish to work with newer versions of .mat files. So I downloaded pre-built HDF5 files for CMake and given the directory path when…
Bializm
  • 1
  • 4
0
votes
0 answers

Error when compiling MATIO library: "Undefined reference to 'Mat_Open'"

so after building and installing the MATIO library using CMake, I am now having problems compiling it. Here's my code: #include #include #define tS(x) std::cout<<"\t"<<(#x)<<" == "<<(x)<<"\n" int main(int argc, char **argv) { …
Bializm
  • 1
  • 4
0
votes
0 answers

Can't build the MATIO library

So I have a project in which I must read structs from MAT files and save them with my C++ code, so I looked everywhere for a fitting library to use and so I came stumbled upon the MATIO library. Thing is, out of all the libraries I have used so far…
Bializm
  • 1
  • 4
0
votes
1 answer

How can I convert a 3D C# array to a 3D Matlab array as an importable .mat file?

I have a 3D double array double[,,] surfaceData = new double[5, 304, 304]; that I then populate with nested for loops. It works great in C#, but how do I convert it to a .mat Matlab-readable file? I am using csmatio. I can output .mat files with…
Mini
  • 445
  • 5
  • 17
0
votes
2 answers

Reading in Matlab .mat file: variable's rank and dims correct, but data is NULL

I'm trying to read in a .mat file from Matlab using matio and the variable comes in with the the correct rank and dims, but the data is null: mat_t *matfp; matvar_t *matvar; matfp = Mat_Open("the_file.mat",MAT_ACC_RDONLY); matvar =…
brian
  • 157
  • 2
  • 10
0
votes
1 answer

Convert uint16 Matlab matrix into a Java short[][] using jmatio?

I am trying to convert a uint16 Matlab matrix (size: 1109-by-1024) into a Java short[][] using the jmatio library. Following is the code: String name = "array_re"; String fileName = "microsec.mat"; MatFileReader matfilereader = new…
sto_user
  • 31
  • 1
  • 8
0
votes
1 answer

Linking error while compiling MatIO

I have built matio using the intructions provided here. But when I try to run the code given below, I get the following error: /tmp/ccIrtdDv.o: In function `main': test.cpp:(.text+0x39): undefined reference to `Mat_Open' test.cpp:(.text+0xaa):…
bluechill
  • 437
  • 1
  • 7
  • 24