I have two large vectors. The first is a list of measurement values and the second is a categorical identification variable (5 different variables). I am trying to create a matrix of 5 columns (one for each categorical identifier) with all of the measurement values as the different rows?
No products are associated with this question.
If you are guaranteed the same number of categorical variable, then
[~,idx] = sort(categoricalVariable); measurementVariable = measurementVariable(idx); measurementVariable = reshape(measurementVariable,,5);