clear; clc;

N = 1e6;

tic
A = [];
for i = 1 : N
    A = [A, i ^ 2];
end
toc

tic
A = zeros(1, N);
for i = 1 : N
    A(i) = i ^ 2;
end
toc

tic
A = [1 : N] .^ 2;
toc

