Difference between two iteration of for loop
2 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
採用された回答
Adam
2018 年 6 月 12 日
diff( P )
after the for loop should do this for you for all pairs of consecutive elements of P
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!