clear; clc;

%% sort
stocks = {'GOOG', 200;
          'AAPL', 150;
          'AMZN', 300};

[sorted, idx] = sort([stocks{:, 2}])
stocks = stocks(idx, :)

%% shuffle
str = 'ntucsie';
idx = randperm(length(str))
str(idx)