Problem in loop in programme

조회 수: 1 (최근 30일)
Mahesh Dalwani
Mahesh Dalwani 2020년 4월 4일
답변: Shivani Dixit 2021년 6월 30일
When I'm typing i=2:10 in programme, I'm getting a i=2. It's kind of wierd.Can anyone tell what is the problem.
  댓글 수: 2
dpb
dpb 2020년 4월 4일
Not in isolation, no...need enough sample code to reproduce symptom.
Most likely while you're trying to do that you'll uncover the problem yourself... :)
Urmila Rajpurohith
Urmila Rajpurohith 2020년 4월 7일
편집: Urmila Rajpurohith 2020년 4월 7일
Are you still facing the issue?
If yes, sharing of the sample code will be helpful to reproduce the issue.

댓글을 달려면 로그인하십시오.

답변 (1개)

Shivani Dixit
Shivani Dixit 2021년 6월 30일
As per the problem encountered , if you are using it in a loop in a program, the iterating variable 'i' would take up the value as 10 after the program ends. As mentioned the variable 'i' takes a value of 2 , it maybe possible that only first index of i gets assigned to it.
You can share your program details for a better understanding of the problem.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by