Pre allocation in matlab
Ältere Kommentare anzeigen
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!
Akzeptierte Antwort
Weitere Antworten (1)
fred ssemwogerere
am 10 Feb. 2020
leng=length(v); % length of a vector
pA=zeros(1,leng); % pre-allocation with zeros
Kategorien
Mehr zu Mathematics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!