Clear Filters
Clear Filters

How to deal with (i-1)th iteration

3 views (last 30 days)
Godas Srikar
Godas Srikar on 24 Apr 2020
Answered: KSSV on 24 Apr 2020
Hi
I am drafting a program that involves "for" loop in which there is a term with A(i-1) in an expression. In this case, for the first iteration, i-1 results to zero but there won't be any value stored for A(0). How to deal with such situation

Accepted Answer

KSSV
KSSV on 24 Apr 2020
You need to start iteration with 2 ...or take iteration from 1 to n-1.

More Answers (0)

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!