clear; clc;

N = 1e6;

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

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

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