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!