0

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
Suever
  • 64,497
  • 14
  • 82
  • 101
I.S
  • 1
  • 1
  • Can you provide some example input and expected output? – Suever May 24 '16 at 20:39
  • Can you break this up into multiple sentences? – Mad Physicist May 24 '16 at 20:42
  • @Suever I've added an example that I hope clarifies things. My main issue is with using tiedrank on tables. It seemed to work well with cell arrays however I couldn't use a variable grouping function for the whole cell array – I.S May 26 '16 at 13:12
  • @I.S So that looks like the input. What is the output you expect? – Suever May 26 '16 at 13:14
  • @Suever the y column is the output I expect- the ranking of x based on the variable groupings in t – I.S May 26 '16 at 13:19

0 Answers0