Saving a variable value after each for-loop iteration

回答 (1 件)

Mehmed Saad
Mehmed Saad 2020 年 5 月 7 日
編集済み: Mehmed Saad 2020 年 5 月 7 日

0 投票

Initialize a variable for counter and a variable to save values of p (suppose pp) in the start of code (before for loop) . Increment counter every iteration and save values of p in pp by indexing it with counter such that in 1st loop iteration
pp(1) = p;
and in 2nd loop iteration
pp(2) = p;
and goes on

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

質問済み:

2020 年 5 月 7 日

編集済み:

2020 年 5 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by