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
votes
1 answer

Mean of several .mat files of a 3-D Matrix

I have several .mat files, which are all in a 3-D matrix of latitude x longitude x value (70 x 70 x 8760). It looks like this: year2000.mat --> (72 x 70 x 8760), year2001.mat --> (72 x 70 x 8760),until year 2020 I need the long-term mean along the…
Lisa
  • 35
  • 4
-1
votes
1 answer

'list' object has no attribute 'items' for saving list of array as mat file

I want to save a list of NumPy array as a mat file but raised with error 'list' object has no attribute 'items'. You can see my try below: import numpy as np import scipy.io output=[] for i in range(10): a=np.random.randint(0,100,size=(60,60,4)) …
Saman
  • 49
  • 4
-1
votes
1 answer

Extract data fields from inconsistent MATLAB data formats into pandas dataframe

Is there a uniform way to comb through .mat files' field names in python and extract corresponding data regardless of their format? These .mat files include: 1Xn structures 1Xn cell arrays of 1x1 structures (with identical field…
-1
votes
1 answer

how to make a loop for reading and merging .mat files

I am trying to read in .mat files from the specified folder. I want to load them two at a time in consecutive order, merge them together, save the number of columns i want as a new .mat file, and keep doing this for all the files (i will eventually…
nico1234
  • 9
  • 8
-1
votes
1 answer

Using a matrix of data inside a function in MATLAB

I need to know how to extract an arbitrary entry of a matrix inside a function. Say a function f gets two extra input arguments i and j to extract element a(i,j) of a fixed real-valued matrix. The matrix is in the workspace, and is of large size.…
Saj_Eda
  • 203
  • 1
  • 10
-1
votes
1 answer

error Undefined function or method 'min' for input arguments of type 'struct'

I have matrix 3x108 which contains dimension data. I want to find min and max value of my matriks in each row. Here's my code: P = load('grading/dimension.mat'); min_P = min(P,[],3); max_P = max(P,[],3); but it gives me error: ??? Error while…
M.luth
  • 11
  • 3
-1
votes
1 answer

Why mat files size on hardisk and in matlab differs?

i cant understand the following scenario. Initial Matlab Memory on Activity Monitor(on mac) = 969.4MB When I load my .mat file having 80x60x13x15238 images that show size 2.1 GB on Hardisk. The Memory Usage on Activity Monitor reaches 7.80GB and…
khan
  • 531
  • 6
  • 29
-2
votes
1 answer

How to merge two .mat files that contain the same variables

I have two .mat files Argiris1.mat and Argiris2.mat that both contain the same variables ,how can i load them both on workspace and for example if one of the variables is Wkinet which is 100000*1000 matrix for every file and create an 200000*1000…
nikos
  • 46
  • 1
  • 11
1 2 3
14
15