I am writing a program to find max possible number that can be formed from a vector of numbers in string format.
Like A = ["3" "30" "33"] should give "33330". However a normal sort using sort(A,'descend') returns "33303"
Is there any way to use a comparator function in matlab to use as key while doing sort(A) ?
Something along the lines of sort(A,key=compare_function) where my compare function would compare two strings and return which is bigger as per the above logic (for example on inputs "30" and "3" it will form two strings "303" and "330", and return that "330" is bigger as per the logic)
A, or return the permutation that maximizes the concatenated number?