Extrapolating a loop to a threshold

1 vue (au cours des 30 derniers jours)
Andrew Wileman
Andrew Wileman le 24 Sep 2015
Commenté : Andrew Wileman le 24 Sep 2015
Hi, I have a problem in estimating some data up to a threshold. Basically, what I would like to do is pass a data value to an equation and then loop the calculation until it reaches a threshold. Can anyone please help?

Réponse acceptée

Thorsten
Thorsten le 24 Sep 2015
Modifié(e) : Thorsten le 24 Sep 2015
y = 2;
threshold = 10; % sample threshold
while y < threshold
y = y^2 % sample calculation, put your function here
end
  1 commentaire
Andrew Wileman
Andrew Wileman le 24 Sep 2015
That's great, thank you very much Thorsten.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by