Multiple selection of an array
Show older comments
Hello everyone,
i have an array of 150.000 rows, and i want to take the means of 300 rows once every 1460 rows. for example mean of row 1100:1400 and mean of row 2560:2860.
M = mean([
flow(1100:1400);
flow(2560:2860);
flow(4020:4320); ])
i have to take 100 means, but i only get 1 output when i use this. flow is the name of the array i use.
Accepted Answer
More Answers (2)
Star Strider
on 10 Feb 2020
Using a simple loop:
Array = rand(150000,1); % Create Array
v = [1100 : 1460 : numel(Array)];
for k = 1:numel(v)
ArrayMean(k) = mean(Array((0:299)+v(k)));
end
You can use sepblockfun downloadable from here
as follows
M=sepblockfun(flow,[300,inf])
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!