x y1 51 71 92 82 222 115 55 105 20
I'd like to spit out an array of the max y coordinate that corresponds to each x coordinate. So I am using the following code provided in the community:
[uv,~,idx] = unique(xy(:,1)); %what do they correspond to?
xmax = accumarray(idx,xy(:,2),[],@max); %build matrix
[uv xmax]
My question is that if I have additional z column
z197865324
then how can I also pick up the corresponding z values?
Best Answer