clear;
clc;
close all;
x=0:0.1:20;
y1=sin(x);
t=0:seconds(60):minutes(length(x)-1);
figure
plot(t,y1,'DurationTickFormat','hh:mm:ss');
xticks(t(1):minutes(10):t(end));
box off
本文展示了如何使用MATLAB编程语言创建一个时间序列图,使用`plot`函数绘制正弦波数据,并设置时长刻度为hh:mm:ss格式,以便清晰地显示时间段。
clear;
clc;
close all;
x=0:0.1:20;
y1=sin(x);
t=0:seconds(60):minutes(length(x)-1);
figure
plot(t,y1,'DurationTickFormat','hh:mm:ss');
xticks(t(1):minutes(10):t(end));
box off
1642
5365