How to subtract two sequential iteration value in for loop
9 views (last 30 days)
Show older comments
Dear Expert,
If for loop (i=1:2) is generating two vlaues for A. Then how do i subtract the first value from second value?
Thank you
0 Comments
Answers (1)
Torsten
on 8 Oct 2022
Moved: Image Analyst
on 8 Oct 2022
You mean
Aold = 0.0;
for i=1:5
Anew = i^2;
diff_A = Anew - Aold
Aold = Anew;
end
?
0 Comments
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!