필터 지우기
필터 지우기

how to read date time column in matlab

조회 수: 3 (최근 30일)
preeti visweswaran
preeti visweswaran 2017년 4월 18일
댓글: Peter Perkins 2017년 4월 26일
My excel file contains datetime column in the format Sun Mar 5,16:06:17.66 How do I read the column along with the other numeric columns using xlsread. Attached in the snapshot of data.Unable to read Time column with xlsread

답변 (1개)

Peter Perkins
Peter Perkins 2017년 4월 18일
Unless you're using a version of MATLAB older than about R2015a, use readtable, not xlsread. In recent versions, you'll get a datetime variable in the table automatically. In less recent versions, you'll get either a numeric (Excel serial date numbers) or a text variable in the table, depending on how the cells in the spreadsheet are formatted. In either case, call datetime on that table variable to get a datetime variable. For Excel date numbers, use 'ConvertFrom','excel'.
  댓글 수: 3
preeti visweswaran
preeti visweswaran 2017년 4월 18일
I get the error "Attempt to reference field of non-structure array."
Peter Perkins
Peter Perkins 2017년 4월 26일
preeti, you will need to be more specific.

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

카테고리

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