Pre allocation in matlab
Afficher commentaires plus anciens
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!
Réponse acceptée
Plus de réponses (1)
fred ssemwogerere
le 10 Fév 2020
leng=length(v); % length of a vector
pA=zeros(1,leng); % pre-allocation with zeros
Catégories
En savoir plus sur Mathematics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!