How to find a the point where the loop is broken?
Show older comments
I need to find where the diffence starts to be less then 0.01 which should me n = 12
But i can't seem to make it show up by itself?
terms = [2.0000 2.5216 2.6042 2.6379
2.2500 2.5465 2.6130 2.6424
2.3704 2.5658 2.6206 2.6464
2.4414 2.5812 2.6272 2.6500
2.4883 2.5937 2.6329 2.6533];
for index = 1
if terms >= 2
n = abs(terms);
t = diff(n);
elseif t < 0.01
n = find(t);
disp(n)
break
end
end
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!