Time series analysis : data type and format

I everyone
After importing data, I would like to know how to declare a time series in Matlab.
I have tried as suggested in MATLAB here : https://www.youtube.com/watch?v=CsqtMGDnMBw
But I received this error:
Here is the screen of my dataset in Excel attached (Annual data on GDP from 1973 to 2022) :
Thank you in advance for your helpful feedback.
Regards,
Daniel D.

6 comentarios

Dyuman Joshi
Dyuman Joshi el 12 de Sept. de 2023
What do you mean by "define a time series"?
Daniel DEKASSE
Daniel DEKASSE el 12 de Sept. de 2023
Editada: Daniel DEKASSE el 12 de Sept. de 2023
As we declare a dataset in STATA as a time series, sorry for not being specific.
Stephen23
Stephen23 el 12 de Sept. de 2023
Editada: Stephen23 el 12 de Sept. de 2023
"I have tried as suggested in MATLAB here ... But I received this error"
The MATLAB function EXTRACTBEFORE requires two inputs, as its documentation shows:
What do you expect to occur if you call it with only one input?
"After importing data, I would like to know how to declare a time series in Matlab."
Rather than doing that you should probably try to import the data as a timetable:
For example using:
Dyuman Joshi
Dyuman Joshi el 12 de Sept. de 2023
"I have tried as suggested in MATLAB here"
The format of data used in the video is different than yours. You don't need to use extractBefore().
Simply read the data using readtimetable as @Stephen23 has mentioned above.
Daniel DEKASSE
Daniel DEKASSE el 12 de Sept. de 2023
Thank you very much.
Daniel DEKASSE
Daniel DEKASSE el 12 de Sept. de 2023
Thank you @Stephen23

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Preguntada:

el 12 de Sept. de 2023

Comentada:

el 12 de Sept. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by