フィルターのクリア

Difference between two iteration of for loop

3 ビュー (過去 30 日間)
Nasser Hasani
Nasser Hasani 2018 年 6 月 12 日
コメント済み: Nasser Hasani 2018 年 6 月 12 日
Hi I need to have difference between to successive iteration of for loop. As example:
For i=1:n P(i)=statement; end
How can I calculate: DeltaP=P(i)-P(i-1)??!! THANKS

採用された回答

Adam
Adam 2018 年 6 月 12 日
diff( P )
after the for loop should do this for you for all pairs of consecutive elements of P
  1 件のコメント
Nasser Hasani
Nasser Hasani 2018 年 6 月 12 日
Thanks for your answer

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by