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?
조회 수: 4 (최근 30일)
이전 댓글 표시
x = load ('filename');
will this make 'x' have 1374x2 values?
댓글 수: 3
Walter Roberson
2019년 9월 15일
"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 %
답변 (1개)
Guru Mohanty
2020년 1월 17일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Structures에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!