Variables in for loop not updating in following iterations
3 ビュー (過去 30 日間)
I am trying to write a for loop with variables a and b that start at 1 and 6. The first iteration produces 0.5176 and 12, which is correct. However, all following iterations are the exact same. The second iteration should be 0.261 and 24. What am I doing wrong?
N=input('number of iterations')
The loop has only one iteration because N is a scalar
To loop N times, you can use
その他の回答 (0 件)
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!