Pre allocation in matlab
显示 更早的评论
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!
采纳的回答
更多回答(1 个)
fred ssemwogerere
2020-2-10
leng=length(v); % length of a vector
pA=zeros(1,leng); % pre-allocation with zeros
类别
在 帮助中心 和 File Exchange 中查找有关 Mathematics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!