Why does my for-loop substitute only one value throughout 31 iterations?
이전 댓글 표시
Hi all, on the attached file, I am trying to use the for-loop to substitute values for every iteration. However, it seems like the for-loop only substitute one value. What could be the cause of that?
Kind Regards Dursman
댓글 수: 3
Why are you redefining G, H, I, J, K inside the for loop. They are constants so should be defined outside the for loop unless you are expecting them to change. You seem to be telling it to do the same thing every time round the loop. What is supposed to change? You refer to x(i) so I assume you intended to assign something to x(i) rather than just x every time round the loop.
Dursman Mchabe
2018년 10월 22일
Dursman Mchabe
2018년 10월 22일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!