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

Writing MAT files: Access violation writing location after 508 successful calls

I'm running a 64-bit C++ program in VS2012 that processes images and writes the results to a MAT file. For whatever reason, after 508 working iterations, I get: "Unhandled exception at ____ (libmat.dll) in Program.exe:____. Access violation writing…
marcman
  • 3,233
  • 4
  • 36
  • 71
0
votes
1 answer

Segmentation fault in the script for opening MAT-file

I want to open a MAT-file in fortran and I followed the example file. The compilation and linking happen without any errors or warnings. This is the makefile: FC = gfortran FCFLAGS = -g -fcheck=all -Wall INCLUDES =…
WYSIWYG
  • 494
  • 6
  • 23
0
votes
2 answers

appending mat file in java

I have a question about the com.jmatio.io package that I was hoping someone could answer. I am looking to write to a .mat file (using java) that may or may not already exist. If it exists I would like to append the information to the end but if the…
TomMcG
  • 1
  • 6
0
votes
1 answer

how to call .exe file (made from standalone Simulink model) in .m file?

When I use !mdlname -p file.mat in command window of Matlab I have no errors, but when I use the command in .m file I get error that says that mat file can not be located. I tried to put full path name for file.mat like this !mdlname -p…
mladen
  • 11
  • 1
  • 7
0
votes
3 answers

How to transfer Nifti file into .mat Matlab file?

I have a Nifti file, the size of which is 62*62*38. How can I transfer the Nifti file to .mat Matlab file?
Angelababy
  • 247
  • 3
  • 7
  • 16
0
votes
1 answer

matPutVariable: error (matrix::serialize::WrongSize) trying to output data to mat file

I have a created a simulator in C/C++ that is supposed to output the results in a .mat file that can be imported into some visualization tools in Matlab. During the simulation results are stored in a data buffer. The buffer is a std::map
Fabian Jonsson
  • 131
  • 1
  • 9
0
votes
1 answer

Save variable from .mat into a different column of CSV

I have a .mat file with a bunch of variables (cells). They are actually just a column vector of doubles. Sample of what the .mat file looks like. The actual one has more files Name Size Bytes Class Attributes …
SugaKookie
  • 780
  • 2
  • 17
  • 41
0
votes
2 answers

Save and load fft to .mat file

I have an FFT and I want to save this to .mat file and then read it from that .mat file. I want to use my loaded data for a division. Here is my code save ('file_fft','a_fft'); b = load ('file_fft'); c = abs (d_fft) ./ abs (b); In my…
puCCa
  • 1
  • 1
  • 2
0
votes
3 answers

Why does saving/loading data in python take a lot more space/time than matlab?

I have some variables, which include dictionaries, list of list, and numpy arrays. I save all of them with the following code, where obj=[var1,var2,...,varn]. The variables size is small enough to be loaded in memory. My problem is when I save the…
0
votes
0 answers

How do I return mat-file channel names using Python?

I'm manipulating MATLAB mat-files using Python 2.x and have run into a problem I can't even Google my way out of. I found it easy to access anything I wanted in the mat-file once I supply the channel name. As a trivial example, to print the fields…
pminogue
  • 143
  • 1
  • 1
  • 10
0
votes
1 answer

MATLAB: How to access a matrix loaded from a .mat file from a function?

I have three .mat files, m1.mat, m2.mat and m3.mat, each representing a cell array m1, m2 and m3 respectively. I need to access the cell arrays programatically from within a function. Inside the function I declare an array of strings to store the…
Imran
  • 31
  • 7
0
votes
1 answer

Writing in a loop into .mat file from c++

I have quite a big 2D vector of data of results that I want to write into a mat file. I'm quite new to C++ and I read some tutorials on how to use the MAT-File APIs and I understood the syntax must be something of the sort: MATFile…
0
votes
1 answer

how to find a simplified version of this script in order to reuse it several times for other data?

How can I convert this script into a MATLAB function? clc; clear all; %# part 1 set1 = {'AA00XY_2','BB74XY_2','CC92XZ_2','FF03VV_2'}; set2 = {'AA00XY_1','BB74XY_1','CC92XZ_1','FF03VV_1'}; matrices = cell(1,16); %# An empty cell array fileString…
bzak
  • 563
  • 1
  • 8
  • 21
0
votes
0 answers

Why am I unable to load a *.mat file in MATLAB 6.5.10?

When I load a mat file I've previously created in other system, i receive the following message: Error using ==> load Unable to read MAT file "..." File may be corrupt. Note: The dat file contains NaNs
0
votes
1 answer

Generate .mat of Images - Matlab

How can I create a .mat file which holds a bunch of images in matlab? I'm using the images as a training set, so figured it would be easier to load from a .mat than load 100+ images every time I run the program. If I'm thinking about this the wrong…
Reanimation
  • 3,151
  • 10
  • 50
  • 88