필터 지우기
필터 지우기

Sort excel with respect to column date

조회 수: 1 (최근 30일)
Nagham Kabbara
Nagham Kabbara 2015년 11월 9일
답변: Walter Roberson 2015년 11월 9일
hi, in my program the user is able to add data which will be added to an excel sheet, this data contains a date.
what i would like to do is to sort the data in the excel with respect to the column date. i tried importing the array to matlab and use sortrows and i tried running a macro using actxserver but it didn't work!! i don't know if there's something missing here!!!
please help

답변 (1개)

Walter Roberson
Walter Roberson 2015년 11월 9일
If you have R2014b or later, you can use readtable() to read the xls file in a way that the dates will appear as datetime objects that can then be sorted.
If not then you can use xlsread(). If the dates are stored in Excel date format then what you receive in MATLAB will be something you can sort(), even though it will not be exactly in MATLAB datenum format. If the dates are stored in strings in Excel then you can use datenum() to convert them to datenum format, which you can then sort.

카테고리

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