I've got a Mx2 matrix where the first column contains a Group ID number (lets say 1-5) and the second column contains some data value.
I need to separate the data column into multiple vectors based on the Group ID number and right now I'm just using a for loop that checks the Group ID number for each row and then puts the value into a new vector depending on that ID number.
The code works fine, but the for loop takes a long time to execute in Matlab and I was wondering if there is a faster method to accomplish this?
I need to separate the data column into multiple vectors based on the Group ID number and right now I'm just using a for loop that checks the Group ID number for each row and then puts the value into a new vector depending on that ID number.
The code works fine, but the for loop takes a long time to execute in Matlab and I was wondering if there is a faster method to accomplish this?