% is number in list
ar_fl_list = [1,2,3,4,5];
fl_index = 1.1;
fprintf('fl_index %.2f is not in [%s]\n', fl_index, num2str(ar_fl_list));
if (ismember(fl_index, ar_fl_list))
    fprintf('fl_index %.2f is in [%s]\n', fl_index, num2str(ar_fl_list));
else
    fprintf('fl_index %.2f is not in [%s]\n', fl_index, num2str(ar_fl_list));
end

% cumulative sum
a = [1 2 3]
cumsum(a)

ar_rand = rand([20,1]);
cumsum(sort(ar_rand))/sum(ar_rand)
ar_seq = rand([20,1]);
cumsum(sort(ar_rand))/sum(ar_rand)
fl_index 1.10 is not in [1  2  3  4  5]
fl_index 1.10 is not in [1  2  3  4  5]

a =

     1     2     3


ans =

     1     3     6


ans =

    0.0007
    0.0183
    0.0433
    0.0732
    0.1033
    0.1364
    0.1705
    0.2082
    0.2462
    0.2903
    0.3390
    0.3918
    0.4468
    0.5023
    0.5756
    0.6523
    0.7347
    0.8217
    0.9088
    1.0000


ans =

    0.0007
    0.0183
    0.0433
    0.0732
    0.1033
    0.1364
    0.1705
    0.2082
    0.2462
    0.2903
    0.3390
    0.3918
    0.4468
    0.5023
    0.5756
    0.6523
    0.7347
    0.8217
    0.9088
    1.0000