how to read data from a .mat file
이전 댓글 표시
Hi: I have a .mat file named Ey1a which I need to use it in my code as one of the inputs. The file contains complex data (real and imaginary).I read the file like this:
dlmread Ey1a.mat
but I had this error:
Mismatch between file and format string.
Trouble reading number from file (row 1, field 1) ==> MATLA
Error in ==> fiber_commentedoriginal at 38 dlmread Ey1a.mat;
also, I need to use the conjugate of Ey1a in my code, so how to do this as I can not load the Ey1a.mat file itself
채택된 답변
추가 답변 (4개)
James Tursa
2015년 4월 1일
편집: James Tursa
2015년 4월 1일
Use the load function to read .mat files. E.g.,
load Ey1a.mat
댓글 수: 4
Naema
2015년 4월 1일
per isakson
2015년 4월 1일
편집: per isakson
2015년 4월 1일
What does
whos -file Ey1a.mat
show?
Naema
2015년 4월 1일
Vinod Sudheesh
2015년 4월 1일
1 개 추천
You could use the "load" command to read data stored in a MAT file.
>> load Ey1a.mat
The "dlmread" function is used for reading ASCII delimited file.
LUI PAUL
2015년 4월 1일
0 개 추천
for other directory.....
load('D:\data_file\Eyla.mat')
for current directory load('Eyla.mat');
or follow the figure....

LUI PAUL
2015년 4월 1일
0 개 추천
to get conjugate
load('Eyla.mat');
Eyla=conj(Eyla);
카테고리
도움말 센터 및 File Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!