clear;clc;

a = [10,20,30;46,11,38;2,99,12];

% sort the element column wise in ascending order. b [2,11,12;10,20,30;46,99,38]
b = sort(a);

% sort the elements row wise in ascending order. c  [10,20,30;11,38,46;2,12,99]
c = sort(a,2);

% sort the elements column wise in decesnding order. d [46,99,38;10,20,30;2,11,12]
d = sort(a, 'descend');

% sort the element in row wise in descending order. e [30,20,10;46,38,11;99,12,2]
e = sort(a,2,'descend');

results matching ""

    No results matching ""