How to import dates from excel files
조회 수: 1 (최근 30일)
이전 댓글 표시
Upon running the following code:
filename = 'Bitcoin_Data_Lab_9.xlsx';
A = xlsread(filename);
T = readtable(filename)
The outputs are similar to the spreashseet but not identical. A has completely deleted the dates column and only shows the numerical ones, while T has every column but every date which was in the dates column is now NaN (my dates are formatted as (mm/dd/yyyy). How can I make it so that the dates are displayed (preferably with xlsread but either function is acceptable).
For reference, the excel file is attached above.
댓글 수: 2
Mitchell Thurston
2021년 12월 8일
my guess is you're going to want to interpret the dates column as a string. going off of this, it would be something like
opts = detectImportOptions(filename);
opts = setvartype(opts, 'Dates','string');
T = readtable(filename, opts)
답변 (1개)
Yusuf Suer Erdem
2021년 12월 8일
Could you try like below?
filename = 'Bitcoin_Data_Lab_9.xlsx';
A = readcell(filename);
T = readtable(A)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!