%#codegen
% Float2Fixed wrapper for function 'sort'
function [Y, I] = sortx(X, DIM, MODE)
    switch nargin
        case 1
            switch nargout
                case 1, Y = sort(X);
                case 2, [Y, I] = sort(X);
            end
        case 2
            switch nargout
                case 1, Y = sort(X, fi_toint(DIM));
                case 2, [Y, I] = sort(X, fi_toint(DIM));
            end                
        case 3
            switch nargout
                case 1, Y = sort(X, fi_toint(DIM), MODE);
                case 2, [Y, I] = sort(X, fi_toint(DIM), MODE);
            end            
    end
end
