필터 지우기
필터 지우기

Trouble importing Excel files into Matlab

조회 수: 1 (최근 30일)
Alessandro M
Alessandro M 2016년 1월 4일
댓글: Alessandro M 2016년 1월 4일
Hi I'm using this code to import an Excel file into Matlab:
[data,text]=xlsread('excelfile.xls','Sheet1');
And I'm trying to get all the data in the workspace item "data" and all text and date in the item "text". The problem is that Matlab doesn't seem to recognize my dates as dates so it doesn't put them into the "text" item.
Any idea?

답변 (1개)

Walter Roberson
Walter Roberson 2016년 1월 4일
Excel dates are numeric values to which a date cell format has been applied. They read in as numeric, and then you have to convert the numeric values because they does not have the same origin time as MATLAB does.
If you have R2013b or later you can use readtable(), and especially if you have R2014b or later then readtable() will recognize them as dates and convert them to datetime objects in the table.
  댓글 수: 1
Alessandro M
Alessandro M 2016년 1월 4일
It says:
Error using readtable
Too many output arguments.

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

카테고리

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