For Loop not working. Not iterating through my data.

조회 수: 2 (최근 30일)
Kimberly Hernandez
Kimberly Hernandez 2019년 7월 4일
댓글: Kimberly Hernandez 2019년 7월 5일
I have attached my documents below. I have stepping through my code and apparantly my code enter my IF statement. not sure why?? what did I do wrong?

답변 (1개)

the cyclist
the cyclist 2019년 7월 4일
I did not try running your code, but I'm pretty confident that this line
if time5_00(x+1)> timeV_5_00(y) >time5_00(x)
is not doing what you intend.
I'm guessing you think that that is going to check if timeV_5_00(y) is between the other two times. But it does not do that. The MATLAB if statement syntax does not operate like that. (You might want to take a look at the documentation.)
If I am correct about that, you need to code that line as
if (time5_00(x+1)> timeV_5_00(y)) && (timeV_5_00(y) > time5_00(x))
  댓글 수: 1
Kimberly Hernandez
Kimberly Hernandez 2019년 7월 5일
It is still not entering the if statement. I feel like the problem is that it isn´t iterating through my data to fulfill my conditionals.

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

카테고리

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