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)).']

u = linspace(-1.15, 75.4)
v = linspace(100, -100, 201)
v = 100:-10:-100
v = linspace(100, -100, 200/10+1)

M1 = nan(2)
M2 = ones(1, 4)
M3 = diag([2 3 -5])
M4 = diag([1 1 1], 1)
M4 = [zeros(4, 1) [eye(3); zeros(1, 3)]]
M4 = diag(ones(3, 1), 1)

A1 = zeros(0, 0, 0) % or ones(...) etc.
A2 = double.empty(0, 0, 0)

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)

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

x = (1:5).'             % entering vector
x = repmat(x, [1 10]);  % 1. option
X = x(:, ones(10, 1));  % 2. option

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

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

x = linspace(0, 2, 101);
y = x.';
f = x.*y;
figure;
surf(x, y, f)

A = rand(2 + randi(10), 3 + randi(5));
A = cat(3, A, rot90(A,2))
size(A)
numel(A)
length(A)
ndims(A)

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

% correct code
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);

M = randi([0 1], 5, 5);
percentage = 100 - 100 * sum(sum(M)) / numel(M);

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

clear; clc; close all;
m = 1.673e-31;  Q = 1.609e-19;
v0 = 1e7;  E = 1e5;  B = 0.1;
t = linspace(0, 1e-9, 1001);
v = Q * E * t / m + v0;
z = 0.5 * Q * E / m * t .^ 2 + v0 * t;
r = v * m / (B * Q);
f = v / (2 * pi * r);
x = r .* sin(2 * pi * f * t);
y = r .* cos(2 * pi * f * t);
comet3(x, y, z);