필터 지우기
필터 지우기

plot the month and year in X-axis

조회 수: 3 (최근 30일)
thomas gisiri
thomas gisiri 2020년 7월 31일
댓글: thomas gisiri 2020년 8월 1일
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.

채택된 답변

Serhii Tetora
Serhii Tetora 2020년 7월 31일
편집: Serhii Tetora 2020년 7월 31일
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')
  댓글 수: 1
thomas gisiri
thomas gisiri 2020년 8월 1일
thanks alot its working now.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time Series Events에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by