Import date data from excel
Show older comments
I have an excel sheet with two columns. The first column has the date in the format mmm-yy and the second column has the values.
Column A Column B Jan-05 Value Feb-05 Value Mar-05 Value
I imported the dates successfully as,
month_year=xlsread('Filename','A2:A133'); formatOut = 'mmm-yy'; month_year = datestr(month_year,formatOut)
The output month_year is of 'char' type of 132x6.
I wish to plot with x-axis being month_year and y-axis the corresponding values. So I write something like,
month_year=datenum(month_year,'mmm-yy') plot(month_year, data) datetick('x','mmmyyyy','keepticks','keeplimits')
However in the process all the dates in the x-axis are now 'Jan 00'
How do I solve this ?
Accepted Answer
More Answers (1)
KSSV
on 18 Jan 2018
Use this:
[num,txt,raw] = xlsread(myfile) ;
1 Comment
Sayantan Sahu
on 18 Jan 2018
Categories
Find more on Data Import from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!