Take average of 1000 to be 100 values

1 vue (au cours des 30 derniers jours)
Brave A
Brave A le 20 Juil 2022
Commenté : Brave A le 21 Juil 2022
I have some data 1000 value way too big for what I want to see when I plot them. I want to be able to average them into 100 values . Is there any way to do this?
I have been attached the 1000 values as text file.
Thanks

Réponse acceptée

KSSV
KSSV le 20 Juil 2022
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1071425/LEARN_users.txt') ;
clc;
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1071425/LEARN_users.txt') ;
A = T.(1) ;
figure(1)
plot(A)
% do averaging
B = reshape(A,[],10) ;
B = mean(B,2) ;
figure(2)
plot(B)
  4 commentaires
Brave A
Brave A le 20 Juil 2022
Modifié(e) : Brave A le 20 Juil 2022
Both of them are not working with me :(
I tried to save the new 100 values into text file or even open them.
Brave A
Brave A le 21 Juil 2022
Sorry how to generate 500 from those 1000 values?
I tried many numbers doesnot work.
Thanks in advance!

Connectez-vous pour commenter.

Plus de réponses (1)

David Hill
David Hill le 20 Juil 2022
r=mean(reshape(yourData,10,[]));
  1 commentaire
Brave A
Brave A le 20 Juil 2022
Is there anyway to save them in file?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Printing and Saving dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by