MATLAB: Split array into multiple columns based on another array

arraymatrix manipulation

Hi, I have 2 double arrays, 1 array (DHB_combine)is values and the other is index (index_combine). I want to split DHB_combine into multiple columns based on the index.

Best Answer

result = splitapply(@(x) {x}, DHB_combine,index_combine);