Read a .mat file and write .csv without opening matlab
이전 댓글 표시
I would like to read a ".mat" file and write it out as ".csv" file without opening matlab.
Basically this:
M = dlmread('FileName.mat', '\t', 1, 0);
csvwrite('FileName.csv', M)
but then without opening matlab.
I'm using linux command line.
Thanks!
채택된 답변
추가 답변 (2개)
Michael02139
2016년 10월 25일
0 개 추천
댓글 수: 2
Marc Jakobi
2016년 10월 25일
That was all about writing a CSV file. Loading a MAT file should be trivial:
load('matFileName.mat')
If you don't know which variables are contained in the mat file, you can load it into a struct:
S = load('matFileName.mat');
varNames = fieldnames(S);
etc.
Michael02139
2016년 10월 25일
Walter Roberson
2016년 10월 25일
0 개 추천
Is the mat file text with tab delimiters or is it a binary file created by save()?
If it is text with tab delimiters then consider just using sed to change the tabs into comma
카테고리
도움말 센터 및 File Exchange에서 Standard File Formats에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!