a = ['B', 'C', 'D']; s = ['B', 'D', 'D'];
sum(a ~= s)
sum(a == s)
sum((a == s) * 2 - length(a))
sum((a == s) * 2 - (a ~= s) * 1)
g = ['C', 'C', 'N', 'N'];
(1 * (g == 'C') + 0 * (g == 'N')) / length(g)
(1 * sum(g == 'C') + 0 * sum(g == 'N')) / length(g)
g = 75; c = [101 90 80 70 0]; s = ['A' 'B' 'C' 'D'];
s(sum(g >= c) + 1)
s(sum(g < c))
g = [95 75 65]; c = [101 90 80 70 0]; s = ['A' 'B' 'C' 'D'];
s(sum(repmat(g', 1, 5) < repmat(c, 3, 1)) + 1)
s(sum(repmat(g', 1, 5) < repmat(c, 3, 1), 2))
add(1, 2)
lincom(1, 2, 3, 4)
lincom(1, 2, 3)
lincom(1, 2)
mxn([1, 2, 3])
[a b] = mxn([1, 2, 3])
sum(f1(2))
sum(f2(2))
function z = add(x, y)
    z = x + y;
end
function z = lincom(x, y, u, v)
    arguments
        x; y; u = 1; v = 1;
    end
    z = u * x + v * y;
end
function [mx, mn] = mxn(x)
    mx = max(x);
    mn = min(x);
end
function v = f1(x)
    v = [x, x + 1];
end
function [u, v] = f2(x)
    u = x; v = x + 1;
end