I have a table in Matlab2016 and I'd like to apply a function on groupings of a column. I know the splitapply function can do this but I'd like to use a function such as tiedrank where the output is nonscalar but still specific to the entries in the column it is applied to.
For example, I want to calculate the y column using the tiedrank function on the elements in the x column. The tiedrank should be based on the groups [0,1] under t. So ranking the elements with t value 0 and t value 1 seperately. Preferably using a function that can be applied once for the whole table. Is there any way to do this with the splitapply function or any other function? Thanks!
t x y
0 3 1
1 8 1
0 5 3
0 4 2
1 9 2