how can i convert the 1 sec file to 1 min by averageing the reading of each 60 rows and the program repeat it every 60 rows?

1 vue (au cours des 30 derniers jours)
i had two data series of magnetic survey, one every 1 sec and the other every 1 min. how can i convert the 1 sec file to 1 min by averageing the reading of each 60 rows and the program repeat it every 60 rows?

Réponse acceptée

dpb
dpb le 23 Août 2014
The Matlab "trick" for this is to rely on memory storage order...
x=mean(reshape(x,60,[])).';
leaves column vector of the averages of the 60-element columns created by the reshape operation. If you number of elements isn't precisely divisible by 60, you'll need to account for it in the second argument when reshape to the multiple or truncate first.
  5 commentaires
zeinab
zeinab le 23 Août 2014
Modifié(e) : zeinab le 23 Août 2014
thanks alot i will try this, but could you tell me if for loop will work? and how?
dpb
dpb le 23 Août 2014
It would, but why not use the facilities of Matlab array operations? It's the whole point of Matlab.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical 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!

Translated by