MATLAB: Pre allocation in matlab

preallocationsize;

v = [0 8 1 2 6 4 8]
How do I determine length of the vector?
Also, how do I pre-allocate the descending vector with all zeros?
Thank you!

Best Answer

length(v)
zeros(size(v))