I have a data like below:
49.6 46.1
49.65 46.3
50.1 47.03
50.2 47.06
51.35 46.027
51.36 46.20
I want to find the mean values of both column based on specific range of first column. for example in range of [49-50) I should calculate the mean values of the first column and mean of corresponding values in the second column. In this example the sub-array (first column only) with numbers
49.6
49.65
will be in range of [49-50) so I want to find the mean value for them and the mean value of the corresponding values in the 2nd column.
The range would be like 49:1:100
. The code below doesn't work properly.
for i=49:1:100
meanWithinRange(i) = mean(data(i,1));
end