i want to store all iteration value in the variable.

2 ビュー (過去 30 日間)
GHUFRAN AHMAD KHAN
GHUFRAN AHMAD KHAN 2018 年 12 月 30 日
回答済み: madhan ravi 2018 年 12 月 30 日
every time the loop are executing then the previous value are overwritten. so please give valuable solution.

採用された回答

madhan ravi
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 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by