%% SL 20
>> A = [-1 1; 1 -2]
>> B = [1 2 3; 4 5 6; 7 8 9]

%% SL 21
>> a = 1
>> b = 5;

>> a = 1, b = 5
>> a = 1; b = 5;

>> c = [1 0 0]
>> d = [0; 0; 1]

%% SL 24
>> a3 = -2/4
>> a4 = -0.5
>> a5 = -.5

>> 3*5*6
>> a1 = 15
>> a2 = 10;
>> a2/a3
>> a2/a3*a4
>> a2/(a3*a4)

%% SL 25
>> A = [1 1 1]; B = [2 2 2]; % SHIFT + ENTER
C = [2 3 2];

>> A1 = [ 1 1 ...
    2 3]

>> A2 = [ 1 1
    2 3]

%% SL 27
>> a = 3.24; alpha = pi/7;
>> a*sin(alpha)^2 + a*cos(alpha)^2 - a

>> a = 14; b = 28;
>> log10(a) + log10(b) - log10(a*b)

>> T = [1/2 1/3 1/4 1/5; 6 7 8 9; 0.2 0.3 0.4 0.5];
>> sum(T, 2)

%% SL 28
>> u = [1 2 3]; v = [3 2 1];
>> u*transpose(v), v*transpose(u)
>> v.'*u, u.'*v
>> dot(u, v), cross(u, v)

%% SL 30 
>> T = 10 + 4*randn(7, 7);
>> trace(T)

>> U = [1 2 3; 0 2 0; ...
0 -2 -1];
>> det(U)

>> A = [1 2 3; 4 5 6; 7 8 1];
>> b = [6 15 16].';
>> x = inv(A)*b;
>> % OR
>> x = A \ b;

%% SL 35
>> z = 1 + 1j;
>> s = conj(z);
>> % OR
>> s = z'

>> Z = abs(z)
>> phi = angle(z)
>> phi_deg = phi/pi * 180
>> zm = Z*(cos(phi) + 1j*sin(phi))

%% SL 37
>> F = [2 2] + [1 -3] + [2 0] + [2 -1.5]
>> Fn = F / norm(F)

%% SL 38
>> norm(w1)
>> sqrt(w1*w1.')

>> norm(w1)
>> sqrt(dot(abs(w1), abs(w1)))

%% SL 39
>> a = 2; b = 5; c = 3;
>> D = b^2 - 4*a*c;
>> x1 = (-b + sqrt(D))/(2*a);
>> x2 = (-b - sqrt(D))/(2*a);

>> roots([-2 -5 -3])
>> roots([2 5 3])

%% SL 40
>> a = 3; b = 4;
>> c = hypot(a, b)
>> c = sqrt(a^2 + b^2)
>> c = sqrt([a, b]*[a; b])
>> c = sqrt(sum([a^2, b^2]))
>> c = sqrt(dot([a, b], [a, b]))

%% SL 41
>> v = [1; 2; 3];
>> a1 = pi/3;
>> R = [cos(a1) 0 -sin(a1);...
0 1 0;...
sin(a1) 0 cos(a1)];
>> v2 = R * v

%% SL 42
>> r = 1 + 10*rand(1)

>> round(r)
>> ceil(r)
>> floor(r)
>> fix(r)
>> fix(100*r)/100

>> rem(r, 0.1)
