필터 지우기
필터 지우기

reading .xlsx files and saving as .mat files

조회 수: 1 (최근 30일)
John
John 2011년 12월 15일
댓글: Alayt Abraham Issak 2019년 1월 18일
Hello,
I'm trying to read in .xlsx files from the current folder and save them as .mat files to the same folder. However, the files are not being saved and I'm not sure why. Could somebody please advise me?
Also it would great if the .mat file names had the same names as the .xlsx files.
Thank you
This is the code I'm using:
files = dir('*xlsx.');
for k = 1:numel(files)
[num,text,raw]=xlsread(files(k).name);
save(files(k).name);
end
  댓글 수: 1
Alayt Abraham Issak
Alayt Abraham Issak 2019년 1월 18일
I am trying to do the same thing but Im a beginner.
Where do I type my excel file so I can get the same output?

댓글을 달려면 로그인하십시오.

답변 (1개)

RNTL
RNTL 2012년 2월 10일
try ... [num,text,raw] = xlsread(files(k).name) [dummy,myName] = fileparts(files(k).name); save(myName) end
so the file extension is removed prior saving. i think you're overwriting your excel file.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by