Difference between two iteration of for loop
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nasser Hasani
am 12 Jun. 2018
Kommentiert: Nasser Hasani
am 12 Jun. 2018
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 Kommentare
Akzeptierte Antwort
Adam
am 12 Jun. 2018
diff( P )
after the for loop should do this for you for all pairs of consecutive elements of P
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!