MATLAB Answers

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 件のコメント
Urmila Rajpurohith
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.

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by