Effacer les filtres
Effacer les filtres

Excel date column export into Matlab and plot

1 vue (au cours des 30 derniers jours)
Isa Isa
Isa Isa le 17 Sep 2013
Hi, Please I have excel file that conntains a date column and another column. I wish to plot the date on x axis and the second column on y axis. I have problem with date column in matlab. Please assist.
3/1/2014 7080.351
4/1/2014 6489.479
5/1/2014 5848.211
6/1/2014 5275.638
7/1/2014 4875.981
8/1/2014 4461.803
9/1/2014 4113.059
10/1/2014 3840.401
11/1/2014 3629.337
12/1/2014 3466.029
1/1/2015 3315.5
2/1/2015 3187.037
Please assist on how to plot this using Matlab. Thanks Isa
  6 commentaires
Isa Isa
Isa Isa le 17 Sep 2013
Thanks Jan. This is my code. data=xlsread('DataTest','Sheet1'); q=data(:,2); time=data(:,1);
Error message
Attempted to access data(:,2); index out of bounds because size(data)=[193,1].
Matlab is not reading the first column of the excel file that contains the date so it takes the second column as the first column as a result it could not find second column. Please help
Isa Isa
Isa Isa le 18 Sep 2013
Hi, I have this code wt=xlsread('DataTest','sheet1'); datecol = 1; wt(:,datecol) = wt(:,datecol) + datenum('30-Dec-1899'); x=wt(:,1); qo=wt(:,2); plot(x,qo);
How do I use datetick to get the x (date axis) in day-month-year ('dd-mmm-yyyy') format? Thanks Isa

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by