Difference between two iteration of for loop
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Adam
le 12 Juin 2018
diff( P )
after the for loop should do this for you for all pairs of consecutive elements of P
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!