"Using intervals of delta t=1" does not mean
h = 0.1;
t = 0:h:100;
but h=1. Then the 2nd question is easy:
[value, index] = min(abs(y_heun - (-0.2)))
Remember, that the time starts at 0, but the index at 1.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!