how to convert character data to double?

조회 수: 2 (최근 30일)
Lilya
Lilya 2018년 11월 3일
댓글: Lilya 2018년 11월 4일
Hi all,
i have a char array that has these values below, which i want to get a bouble array of it.
01/04/2016
02/04/2016
03/04/2016
04/04/2016
.... %etc until
20/05/2016
Any help would be appreciated.
Thanks

채택된 답변

madhan ravi
madhan ravi 2018년 11월 3일
편집: madhan ravi 2018년 11월 3일
Use
datenum() or datetime()
Example:
DateString = ['01/04/2016';'02/04/2016';'03/04/2016';'04/04/2016';'20/05/2016'];
formatIn = 'mm/dd/yyyy';
datenum(DateString,formatIn)
datetime(DateString)
Use datetime as suggested by sir Walter
  댓글 수: 3
madhan ravi
madhan ravi 2018년 11월 3일
Thank you sir Walter
Lilya
Lilya 2018년 11월 4일
Thank you so much it works! .. I do have another question I have also the attached figure data that I want to extract the specific rows from it depends on the dates those are represented as the first 8 column in the files.name stract. How can I use that? to get the finale files are from day 1 of April 2016 until 20th of May 2016. thanks for the help :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by