plotting two data sets with different number of data point against one time series x axis

9 次查看(过去 30 天)
I have two data sets
first data set consists of 86 400 elements because it is taken in every seconds
second data set is the same data set but taken in every minute therefore its number is less and equals to 1440
is there any way to plot those two data sets against one x axis which contains time corresponding to first data set
thank you in advance

回答(1 个)

Voss
Voss 2022-2-5
% generate some random data for demonstration:
% second data:
data_1 = randn(86400,1)+(1:86400).'/40000;
% minute data:
data_2 = mean(reshape(data_1,60,[]),1).';
% pick a number between 0 and 60 to adjust how they line up:
second_offset = 30;
% plot:
figure();
plot(data_1);
hold on
plot((1:numel(data_2))*60-second_offset,data_2,'LineWidth',2);

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by