MATLAB: Preallocate an matrix in 2 for loops

MATLABpreallocate

How would I preallocate This matrix?
for j=1:numel(A)
for i=1:numel(A)
B(j,i)="Calculation here"
end
end

Best Answer

N=numel(A);
B=zeros(N,N); %This is how
for j=1:N
for i=1:N
B(j,i)="Calculation here"
end
end