Plotting date and time

2 visualizaciones (últimos 30 días)
Sahar khalili
Sahar khalili el 6 de Jul. de 2021
Editada: Sam el 6 de Jul. de 2021
Hello,
I have a cell which contains date and time.
zenithtime =
'11-Jul-2020 13:57:00'
'12-Jul-2020 13:57:00'
'13-Jul-2020 13:57:00'
14-Jul-2020 13:57:00'
'15-Jul-2020 13:57:00'
'16-Jul-2020 13:57:00'
'17-Jul-2020 13:57:00'
'18-Jul-2020 13:57:00'
'19-Jul-2020 13:57:00'
'20-Jul-2020 13:57:00' ....
I seperate the date and the time.
t = datetime(zenithtime);
v = datevec(t);
Var1 = datetime(v(:,1:3));
Var2 = duration(v(:,4:end));
var1='11-Jul-2020'
'12-Jul-2020'
'13-Jul-2020'
'14-Jul-2020'
'15-Jul-2020'
'16-Jul-2020'
'17-Jul-2020'
'18-Jul-2020'
'19-Jul-2020'
'20-Jul-2020' .....
var2 = '13:57:00'
'13:57:00'
'13:57:00'
'13:57:00'
'13:57:00'
'13:57:00'
'13:57:00'
'13:57:00'
'13:57:00'
'13:57:00' .....
Now I want to plot the date and the time.
plot (var1,var2)
But I face this error "Unrecognized function or variable 'var1'."
Does anyone know how can I fix it?

Respuestas (1)

Sam
Sam el 6 de Jul. de 2021
Editada: Sam el 6 de Jul. de 2021
This link should help solve your problem

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by