How to repeat a command until a condition is met?
Show older comments
Here is my part of my code thus far. How would I decrease value of Df until v is approximately 70?
Df=100;
V=exp(-r*T)*min(Df*x_non_us(m+1,:),S_us(m+1,:));
v=mean(V);
while
if abs(v-70)>.1
Df=Df-.05;
else
Df=Df;
end
end
Df
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!