Pre allocation in matlab
Mostra commenti meno recenti
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!
Risposta accettata
Più risposte (1)
fred ssemwogerere
il 10 Feb 2020
leng=length(v); % length of a vector
pA=zeros(1,leng); % pre-allocation with zeros
Categorie
Scopri di più su Mathematics in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!