How to repeat a command until a condition is met?
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!