I am trying to streamline my code. I have a 2-column array from which I’d like to extract the averages of the columns and store them as X and Y.
I tried using the following code:
[x y] = mean(theArray);
…However, this returns
??? Error using ==> mean
Too many output arguments.
For now, I have settled with the three lines:
coords = mean(theArray);
x = coords(1);
y = coords(2);
I’m sure there must be a much simpler way of doing this in less than three lines. My code is running an eye tracking device at 1000Hz and I want to avoid any unnecessary processing…
Any wisdom gratefully received
In two lines: