Average numbers in array
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hello,
I've got an array with 65926x2 values. I try to make average when the 1st column got numer of 600 and write in the a new array as 1st cell. Then i want a next average till the numer of 1st column is 1200. What i mean is the time_space_average=[0:600:604800];
So at the end i want to have an array with 1009x1 elements. i will put excel table and picture of the data arrays!
Thanks in advance!
0 Commenti
Risposte (1)
KSSV
il 4 Ago 2021
You may proceed some like this shown below:
T = readtable('C:\Users\KSSV\Downloads\1.xlsx') ;
x = T.(1) ; y = T.(2) ;
idx = 0:600:604800;
[c,ia] = ismember(idx,x) ;
n = length(ia);
iwant = zeros(n-1,2) ;
for i = 1:n-1
iwant(i,:) = [idx(i) mean(y(i:i+1))] ;
end
Vedere anche
Categorie
Scopri di più su Matrices and Arrays 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!