MATLAB: Bucket sort on cell array of vectors cell arraysMATLABmatrixsort hi guys, i need your help in solving the following problem: Given a cell array of vectors, sort them in a bucket sort manner. Here is an example to ease the question: thanks in advance. Best Answer c1 = {[1 2] [10 11];[2 3] [10 11];[1 2] [11 12]; [2 3] [11 12]};c2 = table2cell(sortrows(cell2table(c1)))Note that you haven't defined in the question how you order vectors. The above uses lexicographical ordering.It's unfortunate that sortrows on cell array only work with scalar cell (unless the cells are all of type char), hence the conversion to table and back. Related SolutionsMATLAB: Bucketing values If you have the Statistics Toolbox installed, there is the built-in RANDSAMPLE command to do this.A = [0.8756 0.1185 0.0059];X = randsample(numel(A),5000,true, A); % X gets 5000 samplestabulate(X) MATLAB: Ho to get rid of repeated cells in cells arrays functions contextt={{1 2 3 4},{1 1 2 5},{2 2 2 6 7}} out=cellfun(@(x) unique(cell2mat(x)),contextt,'un',0) Related QuestionSorting cell array containing alphanumeric textHow to get cumulative sum in yearly bucketsAdding same size cell arraysAveraging Data in Buckets of Size nSort cell according to one column of the cellHow we will do bucktization in matlab anyone have a code of bucketization process in matlab so please send me
Best Answer