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

How to make tensorflow cifar10 tutorial read from numpy array?

I am trying to use the CIFAR10 tutorial to create my own training script. My dataset is stored in a MAT file that I convert to a Numpy array using h5py. In the tutorial, they read data using: reader =…
0
votes
1 answer

Save a Matlab Property to a mat file

I have a class with a struct property called myStruct: properties myStruct; end I would like to save the struct to a .mat file. I tried: save -append registers.mat myStruct; But it gives the error: Variable 'myStruct' not found. I have…
user1876942
  • 1,411
  • 2
  • 20
  • 32
0
votes
1 answer

Error using load command to open .mat file in Matlab

Here's a part of my code where I am entering a name of the .mat file, which is located in the same folder as my code. However it does not identify the file name and gives an error: "??? Error using ==> load Unable to read file 'q.mat': No such file…
user238469
0
votes
1 answer

Save and load structure array MATLAB

I am trying to save and load structure arrays in a MAT-file, but the structure array keeps changing every time I reload it. If save the following and reload it, it keeps adding struct in front. struct.field1 struct.field2 save data.mat…
Romano
  • 13
  • 1
  • 7
0
votes
1 answer

check if MAT file is corrupt without load

I have a data set consisting of large number of .mat files. Each .mat file is of considerable size i.e. loading them is time-consuming. Unfortunately, some of them are corrupt and load('') returns error on those files. I have implemented a…
user3342981
  • 85
  • 2
  • 7
0
votes
1 answer

Matlab: How to save num2str(i).mat in matlab?

Suppose I have a for loop and want to save a mat file at each iteration with the name of the iteration. I made it as below but it does not work. clc; clear; for i=1:3 filename=num2str(i); save(filename,'.mat') end
Soyol
  • 763
  • 2
  • 10
  • 29
0
votes
1 answer

Showing Type and Size of a Mat file loaded in Python

I am new to python and I am converting Matlab code to Python. I have loaded the mat file which is a dictionary in Python. I can print the key names, but I cant understand how to show the types and size for the values import scipy.io import os…
Wajih
  • 793
  • 3
  • 14
  • 31
0
votes
2 answers

How to programatically save MATLAB comparison results from visdiff and reload them into the GUI or save as HTML?

The comparison tool visdiff(file1.m,file2.m) report displays the files file1.m and file2.m side by side, and highlights the lines that do not match. In the GUI that pops up you could click and Save comparison report as HTML. You could have assigned…
Aaron
  • 132
  • 2
  • 3
  • 17
0
votes
2 answers

How to convert a 3D matrix into several 2D matrix?

The mat file is a 156*192*25 3D matrix. The data are a series of n=25 images in a mat file. How could I convert this 3D matrix into 25 2D matrix and display them independently? Thanks~
Echo0831
  • 307
  • 2
  • 5
  • 14
0
votes
1 answer

Memory issue with Matlab: update variable in .mat

I am working with a very computational expansive code in Matlab. It requires the usage of optimisation techniques and long computations using very big matrixes. I am having the following issue: even if the code run correctly, at the end of the…
merch
  • 945
  • 8
  • 19
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
0 answers

CHAR16_T type definition in matrix.h. Trying to read Mat-Files

I am trying to read mat-files in C++ in a Qt project. At morning I had next problem: Read Mat Files in C++ in a Qt project, and it is solved already. But now I am having problems with the next issue: matrix.h:267: error: C2146: syntasis error :';'is…
Arritmic
  • 474
  • 2
  • 12
0
votes
1 answer

how to convert nest list into structure(.mat) in matlab

I found rmatio is a nice tool to convert data frame and list into .mat file (although it seems that the character is not supported), but in the following demo, I want to generate a nested list called data_list, but when I use write.mat to export it…
johnsonzhj
  • 517
  • 1
  • 5
  • 23
0
votes
0 answers

Transform a list of nested dictionary into a (co-occurence) matrix form and save it into .mat file type

So I created a python script where from a given data of query logs, I transform it into a list of nested dictionary and write it to a new text file. This is a sample output of my script: [{'ip_address': '10.10.80.209', 'domain_names': {'google.com':…
0
votes
1 answer

How to load *.mat file in raw folder of android

I try to load a .mat file in Android 4.4, using JMatIO. It worked well when the .mat file was in external storage, but it didn't work when the file was in the app's raw folder. Currently, the application can not find any *.mat files. The log just…