Questions tagged [mat-file]

Use with questions about .mat files. These files are used for storing MATLAB variables.

MAT-file is binary file format, used to store data in multiple variables or structures in MATLAB. These files use the .mat extension, and can be accessed in using the load, save or matfile functions. For more information, see MAT-File Versions in the MATLAB documentation.

MAT-files can be also created and read by other programming languages such as Python etc.

Refer to this PDF document for a description of the internals of the MAT-file format (Level 4 and Level 5).

218 questions
1
vote
2 answers

Creating *.mat file from Python without using dictionary

I have few lists which i want to save it to a *.mat file. But according to scipy.io.savemat command documentation i Need to create a dictionary with the lists and then use the command to save it to a *.mat file. If i save it according to the way…
ayaan
  • 715
  • 5
  • 18
  • 36
1
vote
2 answers

How to delete a variable from .mat file in matlab?

I have in my file .mat three matrices, I need to delete one of them. I try clear ('Matrice1'), but it doesn't work.
Guillaume
  • 123
  • 4
  • 13
1
vote
0 answers

Matlab: How to append .mat files in saving workspace during parfor runs?

This link addresses to the way of saving variables in a workspace. Finally for each iteration of a parfor loop one .mat file will be generated. Is there any work around to save workspace in an appending way, so that each iteration's results gets…
Soyol
  • 763
  • 2
  • 10
  • 29
1
vote
1 answer

Warning when saving to matfile in parallel environment

I am trying to process a time signal, which is split up into (many) smaller segments, and each segment ("chunk") is analyzed independently. This output, I want to save in a combined file. My current solution works: configFileName =…
casparjespersen
  • 3,460
  • 5
  • 38
  • 63
1
vote
2 answers

load specific column of a matrix from a .mat file v7.3 containing multiple matrices using for loop

I'm quite new in Matlab and I would be more than grateful if you can help me with the following issue. I have a .mat file v7.3 which has 26 matrices with increasing number i.e. Mw1, Mw2, Mw3.....Mw26 I want to load only the first column from each…
K.Stamato
  • 11
  • 2
1
vote
2 answers

How to create a graph in matlab from a .mat file?

I want to represent a graph in MATLAB using information stored in a .mat file. The .mat file is an NxN square matrix. The goal is to be able to gather information on the graph (number of nodes, average degree, connected components, etc) using the…
jblakeley
  • 816
  • 1
  • 10
  • 20
1
vote
2 answers

Errors in linking fortran code that imports a MAT-file

I have to import a MAT-file in a fortran program. I followed the example file but I am facing some problems while linking. The compilation happens fine. Minimal code: #include "fintrf.h" PROGRAM main USE ssa USE dmotifs USE param IMPLICIT…
WYSIWYG
  • 494
  • 6
  • 23
1
vote
1 answer

Where is the MAT-File library source code?

I see everyone talking about the mathworks provided MAT-File library and api, but I can't seem to find a download link anywhere.... I admit this isn't coding related but it seemed the most appropriate place to ask.
Joshua
  • 374
  • 3
  • 17
1
vote
2 answers

Matlab .mat file saving

I have identical code in Matlab, identical data that was analyzed using two different computers. Both are Win 7 64 bit. Both Matlabs are 2014-a version. After the code finishes its run, I save the variables using save command and it outputs .mat…
ilyas
  • 609
  • 9
  • 25
1
vote
1 answer

H5 vs Mat-File Matlab

I was wondering why a h5 file takes larger space in the harddisk than a normal mat file while the contents are same. I always thought the h5 is the sort of compressed one. The details are below Using a Matlab 2014b in a 64 bit linux-ubuntu code…
user2375049
  • 350
  • 2
  • 15
1
vote
0 answers

error using libmatio / reading mat-files

I'm reading data from mat-files with code below. The code starts to search all subdirectories for mat-files like Dog_1/Dog_1_interictal_segment_1/0001.mat and transposing the matrix data into a csv file. The problem occurs at line 139 when memory is…
user1587451
  • 978
  • 3
  • 15
  • 30
1
vote
2 answers

How do I access the values inside a MATLAB array using Cgo?

Using the MatLab C API and Go's Cgo package, I'm attempting to read a 24x3000000 matrix inside a mat-file in my Go program. I'm able to successfully read the dimensions of the matrix but how do I access the values inside each cell? (The goal is…
Adam Soffer
  • 1,614
  • 5
  • 20
  • 36
1
vote
1 answer

saving python variable to .mat file with scipy.io.savemat

Here is my python code. >>import numpy as np >>import scipy.io >>exon = [ np.array([[1, 2], [3, 4], [5, 6]]), np.array([[7, 8], [9, 10]]) ] >>obj_arr = np.zeros((2,), dtype=np.object) >>obj_arr[0] = exon[0] >>obj_arr[1] =…
Vipin T S
  • 11
  • 1
  • 2
1
vote
1 answer

How can I group variables from a mat file by name and collect them in a structure?

I'm reading in a mat file which has variables with a counter e.g. a1, a2, a3, b, c1 and c2. I want to put the data into a structure with field names "a", "b" and "c" where a=[a1;a2;a3], b=b and c = [c1; c2]. The algorithm needs to be able to do…
barbar
  • 701
  • 1
  • 5
  • 11
1
vote
2 answers

Matlab Comparison Tool NaN values

I am trying to compare two .mat files using the Matlab Comparison Tool. In the comparison result the NaN values are highlighted meaning they are different (even though they are not). How can one handle the NaN values when using the Matlab Comparison…
cloudviz
  • 971
  • 4
  • 15
  • 40