How is datevec used on an m*8 matrix in the form [YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, Day of Year, Value]?
    5 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
I have an m*8 array with the form [YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, Day of Year, Value], and I am unsure how to use datevec or another appropriate function to make the array easier to use, by graphing years, months and days etc. How can I do this?
1980 1 1 0 0 0 1 -27
1980 1 1 1 0 0 1 -20
1980 1 1 2 0 0 1 -23
1980 1 1 3 0 0 1 -28
1980 1 1 4 0 0 1 -32
1980 1 1 5 0 0 1 -32
1980 1 1 6 0 0 1 -32
1980 1 1 7 0 0 1 -31
1980 1 1 8 0 0 1 -33
0 Commenti
Risposta accettata
  KSSV
      
      
 il 4 Apr 2017
        data = [1980  1  1  0  0  0  1  -27
1980  1  1  1  0  0  1  -20
1980  1  1  2  0  0  1  -23
1980  1  1  3  0  0  1  -28
1980  1  1  4  0  0  1  -32
1980  1  1  5  0  0  1  -32
1980  1  1  6  0  0  1  -32
1980  1  1  7  0  0  1  -31
1980  1  1  8  0  0  1  -33];
d = data(:,1:end-2) ;
val = data(:,end) ;
date = datetime(d) ;
plot(date,val)
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Dates and Time 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!