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!