Pre allocation in matlab
Mostrar comentarios más antiguos
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!
Respuesta aceptada
Más respuestas (1)
fred ssemwogerere
el 10 de Feb. de 2020
leng=length(v); % length of a vector
pA=zeros(1,leng); % pre-allocation with zeros
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!