i want to store all iteration value in the variable.
    조회 수: 2 (최근 30일)
  
       이전 댓글 표시
    
every time the loop are executing then the previous value are overwritten. so please give valuable solution.
댓글 수: 0
채택된 답변
  madhan ravi
      
      
 2018년 12월 30일
        Here is an example to avoid overwriting in a loop:
c=zeros(1,10); % preallocate for speed and efficiency
for i = 1:numel(c)
    c(i)= 2^(i);
end
c
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

