mat-file

Txt import in Matlab, different row formats

拥有回忆 提交于 2019-12-11 06:06:27
问题 I need to import variables from a txt file. This file has 3 main parts. A) Initial headlines, containing general information B) Headlines-Variables, in every column C) Numerical data in every column As below: Headlines - Headlines - Headlines - Headlines Headlines - Headlines - Headlines - Headlines # A | B C | D | # ----------+----------------------------+---------------| # 1 | 0.0000E+00 + 0.0000E+00 | 0.0000 | # 2/3 | 0.0000E+00 +/- 0.0000E+00 | 0.0000 | # 4/5 | 0.0000E+00 +/- 0.0000E+00 |

Read Mat Files in C++ in a Qt project

ぐ巨炮叔叔 提交于 2019-12-11 01:46:27
问题 I am trying to read a mat-file in an own mat_file_read.cpp in a Qt project, and I am having problems. My error: error lnk2019: unresolved external symbol matOpen referenced in function "int __cdecl read_mat_file(class QString)" (?read_mat_file@@YAHVQString@@@Z)" In my project.pro, I am including: INCLUDEPATH += C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\include\ LIBS += -LC:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin\win64 -llibmx -llibmat -llibeng In the

Errors in linking fortran code that imports a MAT-file [duplicate]

强颜欢笑 提交于 2019-12-10 11:42:21
问题 This question already has an answer here : Reading data from matlab files into C (1 answer) Closed 4 years ago . 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 NONE ! MAT-FILE Declarations ! INTEGER matOpen, matGetDir INTEGER matGetVariableInfo INTEGER mp, dir, adir(100), pa INTEGER mxGetM, mxGetN,

deleting variables from a .mat file

こ雲淡風輕ζ 提交于 2019-12-09 00:25:36
问题 Does anyone here know how to delete a variable from a matlab file? I know that you can add variables to an existing matlab file using the save -append method, but there's no documentation on how to delete variables from the file. Before someone says, "just save it", its because I'm saving intermediate processing steps to disk to alleviate memory problems, and in the end there will be almost 10 GB of intermediate data per analysis routine. Thanks! 回答1: Interestingly enough, you can use the

Errors in linking fortran code that imports a MAT-file [duplicate]

烂漫一生 提交于 2019-12-08 07:28:28
This question already has an answer here : Reading data from matlab files into C (1 answer) Closed 4 years ago . 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 NONE ! MAT-FILE Declarations ! INTEGER matOpen, matGetDir INTEGER matGetVariableInfo INTEGER mp, dir, adir(100), pa INTEGER mxGetM, mxGetN, matClose INTEGER ndir, i, clstat CHARACTER*32 names(100) !===========================! if(all(fnames(:)%fn

Cannot save really big matrix in Matlab

本小妞迷上赌 提交于 2019-12-07 07:30:51
问题 I have a big array (1024x1024x360) and I want to save it to a mat file. When I just try A=rand(1024,1024,360) save('filename.mat','A'); The variable is created in the workspace, the file is being created, but it remains empty... I'm using Matlab 2012a on Win7-64 machine, Why is that happening? 回答1: Earlier versions of Matlab couldn't save variables larger than 2 GB. Your default save file format may be set to an older type even on newer versions of Matlab; my own install of R2013a seems to

ndim in numpy array loaded with scipy.io.loadmat?

佐手、 提交于 2019-12-06 06:20:42
Using SciPy and MATLAB, I'm having trouble reconstructing an array to match what is given from a MATLAB cell array loaded using scipy.io.loadmat(). For example, say I create a cell containing a pair of double arrays in MATLAB and then load it using scipy.io (I'm using SPM to do imaging analyses in conjunction with pynifti and the like) MATLAB >> onsets{1} = [0 30 60 90] >> onsets{2} = [15 45 75 105] Python >>> import scipy.io as scio >>> mat = scio.loadmat('onsets.mat') >>> mat['onsets'][0] array([[[ 0 30 60 90]], [[ 15 45 75 105]]], dtype=object) >>> mat['onsets'][0].shape (2,) My question is

Cannot save really big matrix in Matlab

青春壹個敷衍的年華 提交于 2019-12-05 13:40:15
I have a big array (1024x1024x360) and I want to save it to a mat file. When I just try A=rand(1024,1024,360) save('filename.mat','A'); The variable is created in the workspace, the file is being created, but it remains empty... I'm using Matlab 2012a on Win7-64 machine, Why is that happening? Earlier versions of Matlab couldn't save variables larger than 2 GB. Your default save file format may be set to an older type even on newer versions of Matlab; my own install of R2013a seems to have come preset to v7, which won't save anything that big. You have two choices: either specify the format

How can I check the contents of a MAT-file in MATLAB without loading it?

余生长醉 提交于 2019-12-03 16:27:39
问题 I have a large structure in a MAT-file. I want to check if a specific field is present in the structure without loading the MAT-file since the contents are very large and I want to minimize memory use. Is this possible, or must I load it first like in the following example?: load('test.mat'); %# Load the MAT-file tf = isfield(s,'fieldname'); %# Check if structure s has field 'fieldname' 回答1: To check the contents of a MAT file without loading it, use: vars = whos('-file','test.mat') ismember(

Write a MAT file without using matlab headers and libraries

眉间皱痕 提交于 2019-12-03 12:13:27
I have some data that I would like to save to a MAT file (version 4 or 5, or any version, for that matter). The catch: I wanted to do this without using matlab libraries, since this code will not necessary run in a machine with matlab. My program uses Java and C++, so any existing library in those languages that achieves this could help me out... I did some research but did not find anything in Java/C++. However, I found that scipy on python achieves this with mio4.py or mio5.py . I thought about implementing this on java or C++, but it seems a bit out of my time schedule. So the question is: