%% SL 12
u = 1:2:99
v = (25:-5:-5).'

T = [-4:-1:-6; 1:3; pi/2 pi/4 pi/6].'

T = [-4:-1:-6; 1:3; pi./(2:2:6)].'
T = [(-4:-1:-6).' (1:3).' (pi./(2:2:6)).']

%% SL 14
u = linspace(-1.15, 75.4)

v = linspace(100, -100, 201)

v = 100:-10:-100
v = linspace(100, -100, 200/10+1)

%% SL 17
M1 = nan(2)
M2 = ones(1, 4)
M3 = diag([2 3 -5])

M4 = diag([1 1 1], 1)
% or
M4 = [zeros(4, 1) [eye(3); zeros(1, 3)]]
% or
M4 = diag(ones(3, 1), 1)

%% SL 27
A = [1 pi; exp(1) -1i]
A1 = repmat(A, [1 3])
A2 = reshape(A.', [1 4])
A3 = repmat(conj(A), [3 1])
A4 = triu(tril(repmat(A, 3), 1), -1)

%% SL 28
A = [1:3; 0:2:4; 0 0 5];
A = repmat(A, [1 2])
B = fliplr(A)
C = flipud(B)

%% SL 35
x = 0:pi/20:2*pi;
f1 = sin(x);
f2 = cos(x).^2;
f3 = f1 + f2;
plot(x, f1, x, f2, x, f3)

%% SL 36
clear; clc;
x = linspace(0, 5*pi, 1e5);
f4 = (-cos(3*x)) ./ ...
(cos(x) .* sin(x - pi / 5) - pi);
plot(x, f4)

%% SL 40
A = rand(2 + randi(10), 3 + randi(5));
A = cat(3, A, flipud(fliplr(A)))

size(A)
numel(A)
length(A)
ndims(A)

%% SL 44
M = 8*rand(3, 4, 2) - 0.5

%% SL 46
clear;
x = linspace(0, 1, 200);
g = x.^3+1; h = x+2;
y = cos(x*pi); z = x.^2;
f = y.*z./(g.*h)
plot(x, f);

%% SL 47
M = randi(2, 5, 5) - 1;

percentage = 100 - 100 * sum(sum(M)) / numel(M);

mainDiagonal = diag(M);
n = sum(mainDiagonal);