alias matlab '/usr/local/bin/matlab -nojvm -nosplash'
where the first option avoids costly start up of Java virtual machine(s),
and the second prevents the advertisement screen on startup.
for k = 1:n
C(1:n,k) = v(1:n);
end
makes n calls for memory allocation from operating system, and it requires
copying over the part of C built up so far to the newly allocated
space each time. Instead use
C = zeros(n,n);
for k = 1:n
C(1:n,k) = v(1:n);
end
Better yet, use: C = v(1:n)*ones(1,n);