xxxxxxxxxx
% Preallocate an integer array of size 1x20
x = zeros(1,20);
% Exmp: Use of preallocated array
for k = 2:20
x(k) = x(k-1) + 5;
end
% Use the appropriate preallocation function for the kind of array you want to initialize:
% - zeros for numeric arrays
% - strings for string arrays
% - cell for cell arrays
% - table for table arrays