How do I import quarterly data from Excel

14 vues (au cours des 30 derniers jours)
Danielau
Danielau le 10 Nov 2021
Réponse apportée : dpb le 10 Nov 2021
Hi.
I have a quarterly data set from the period 1992Q1 - 2021Q2 and is unable to convert it into Matlab.
The purpose is to plot this with the quarterly time frame on the x-axis.
i have attached the the prober forumla and dataset
Hope you can help!!

Réponses (1)

dpb
dpb le 10 Nov 2021
>> tQ=readtable('..\Answers\Data_QFE.xlsx');
>> tQ.Year=datetime(tQ.Year,'InputFormat','uuuuQQQ','Format','uuuuQQQ');
>> head(tQ)
ans =
8×2 table
Year P_KBH
______ ______
1992Q1 5658
1992Q2 5744.2
1992Q3 5780.8
1992Q4 5566.2
1993Q1 5280.9
1993Q2 5446.1
1993Q3 5827
1993Q4 5616.4
>>
Read the doc for datetime to all the formatting options.

Catégories

En savoir plus sur Data Import from MATLAB 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