plotting two data sets with different number of data point against one time series x axis
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Voss
le 5 Fév 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 commentaires
Voir également
Catégories
En savoir plus sur Line Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!