How do I take the average of every 50th term in a 2500x1 vector?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Gaëtan Poirier
am 15 Sep. 2017
Beantwortet: Stalin Samuel
am 15 Sep. 2017
I have a 2500x1 vector and I'm trying to find if the average of the average of every 50th term equals the average of all 2500 variables.
0 Kommentare
Akzeptierte Antwort
Stalin Samuel
am 15 Sep. 2017
s=rand(2500,1); %2500x1 vector
Out1=mean(reshape(s,[50 50])); %mean of every 50 values
out2=mean(s(50:50:2500)) % mean of every 50th value
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!