I have .mat file that has a size of 1374x2. How do I load this in to variable that can be used inside a function?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sylvester Selvanathan Pinto Stephen
am 15 Sep. 2019
Beantwortet: Guru Mohanty
am 17 Jan. 2020
x = load ('filename');
will this make 'x' have 1374x2 values?
3 Kommentare
Walter Roberson
am 15 Sep. 2019
"m is equal to the number of lines in the file"
Non-comment lines. load() of a recognized text file skips lines that begin with %
Antworten (1)
Guru Mohanty
am 17 Jan. 2020
Hi, I understand you are getting error in loading a MAT file. Here is a sample code for this, in which MAT file is created using random data. You can use both load and matfile functions.
%% Create input MAT file
clear all;
val=randi(100,1374,2);
save('val.mat','val');
%% Load MAT file
clear all;
mat_var = load('val.mat');
C = mat_var.val;
0 Kommentare
Siehe auch
Kategorien
Mehr zu Structures finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!