how to read excel data in matlab?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have daily time series data for 10 year in excel sheet (365 values in every year). Now I want to monthly sum this daily data and create a monthly time series (12 values of every year). How to import this excel sheet in matlab? I imported the excel sheet in matlab using import tool but, matlab is not reading format of date.
Example: Date data
01-01-2000 45
02-01-2000 25
03-01-2000 88..............
31-01-2000 56
01-02-2000 69
02-02-2000 28
03-02-2000 63..............
28-02-2000 91
3 Commenti
Helen Kirby
il 15 Apr 2016
This is what I did: Change your DD-MM-YYYY format in your Excel file to MM/DD/YYYY or MM/DD/YY. When it is in this form you can add the constant 695422 to change it from the XL date number to the ML date number. Say your XL date is in J4, you use (J4)+695422. You should keep the XL date around because it is a nuisance to keep having to work out the date from 736085 e.g. After you have a column of ML dates, read in the file as Explorer says above then start picking out your months as you require. You may need "Datevec" for that process.
Risposte (1)
Walter Roberson
il 15 Apr 2016
If you are using R2014b or later, use readtable() and the times will be converted to datetime objects.
If you are using R2013b or R2014a then readtable() still exists but there will be no automatic conversion of the times to time objects.
0 Commenti
Vedere anche
Categorie
Scopri di più su Spreadsheets in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!