How to subtract two sequential iteration value in for loop
조회 수: 2 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Torsten
2022년 10월 8일
이동: Image Analyst
2022년 10월 8일
You mean
Aold = 0.0;
for i=1:5
Anew = i^2;
diff_A = Anew - Aold
Aold = Anew;
end
?
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!