Make a loop to find each first positive value after a negative value in an vector.
Show older comments
HI,
I have a vector with about 2000 positive and negative values. I want to make a loop that finds the first positive point/value after the negative values.
Once the loop has found that point, check if more than 75% of all values after that point are positive.
If yes, save that point into point_found. If not, continue the loop to search for the next positive value/point in the vector.
Once the loop has again found that point, check if from there on, more than 75% of all values after that point are positive.
If yes, save that point into point_found. If not, continue the loop to search for the next positive value/point in the vector. and so on and on until the point/value is found.
If there is no such point or value put into point_found=9999
5 Comments
madhan ravi
on 22 Jul 2019
What have you done for your homework?
Lois Slangen
on 22 Jul 2019
David K.
on 22 Jul 2019
They are implying that this looks like you took a homework problem and instead of doing it just asked it here. It is generally preferred that when asking a question you show what you have tried already.
Lois Slangen
on 22 Jul 2019
Lois Slangen
on 22 Jul 2019
Accepted Answer
More Answers (0)
Categories
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!