Hello i am reading a matrix with 2 columns. The first columns has a radius and the second column stores a value. there are n * m rows, where n is the number of groups and m is the number of elements in each group.
Now i want to find the average every m elements, in this case lets say 10 groups of 11 elements
B(:,1) = accumarray(ceil((1:numel(A(:,1)))/11)',A(:,1),,@mean)
B(:,2) = accumarray(ceil((1:numel(A(:,2)))/11)',A(:,2),,@mean)
Now my 1. question: How can i efficiently find the max and min of each group?
Also later i plot array B like so:
and my 2. question: How can i add the min and max values as an error bar to the plot above? i.e.
Thanks a lot