plotting two data sets with different number of data point against one time series x axis
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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
0 Commenti
Risposte (1)
Voss
il 5 Feb 2022
% 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);
0 Commenti
Vedere anche
Categorie
Scopri di più su Line Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!