plot the month and year in X-axis

7 Ansichten (letzte 30 Tage)
thomas gisiri
thomas gisiri am 31 Jul. 2020
Kommentiert: thomas gisiri am 1 Aug. 2020
Hi everyone,
I want to plot timeseries data in Matlab i have attached the data nature of the data. but some month data are missing and i want the missing month data to see..
can anyone help me the i Can plot the data.

Akzeptierte Antwort

Serhii Tetora
Serhii Tetora am 31 Jul. 2020
Bearbeitet: Serhii Tetora am 31 Jul. 2020
clear;clc;close all
tab = xlsread('data_final');
Date = datetime(tab(:,1),tab(:,2),1);
data = tab(:,3);
[Date,I] = unique(Date);
date_int = Date(1):calmonths(1):Date(end);
data_int = interp1(Date,data(I),date_int);
plot(Date,data(I))
grid on; hold on
plot(date_int,data_int,'--')
legend('Original','Interpolated')

Weitere Antworten (0)

Kategorien

Mehr zu Time Series Events finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by