I have a matrix, say:
y=rand(100,101);
Now I would like to average over the first dimension, and use only part of the output (say only the odd indices) into another function. So I could do
ymean=mean(y,1)
and then
ymean_partial=somefunction(ymean(1:2:length(ymean)))
But my question now is (assuming it is possible): how can I do this without having to declare the 'dummy variable' ymean
? I would like to know if there's a one-liner I could use, since this extra variable takes up a lot of memory for larger matrices (and I tend to like one-liners).
Many thanks!