Hello,
I'm moderately experienced with programming, and I cannot believe how challenging I am finding this hurdle…
Suppose I have the following matrix:
a = [1,1;1,2.5;1,3;2,2;2,2;2,2;3,10;3,11;3,14;3,19;4,9]
and the first column represents a unique site or subject that I need to analyze separately. How can I make, in this case, 4 new matrices or arrays, within the workspace so that I have products that look like this:
site1 = [1,1;1,2.5;1,3]site2 = [2,2;2,2;2,2]
My real data is more advanced than this, of course, but I cannot seem to figure out how to separate the data into separate sub-data sets based on a unique values. This seems to be a simple problem but I've tried looking at for-loops, the command 'unique', etc. and am getting absolutely nowhere.
Thanks ahead of time,
Ryan
Best Answer