How to half the value of a constant inside an iteration?
Afficher commentaires plus anciens
I have an iteration loop. Inside the loop, I have a constant gamma. I want its starting value to be 10e-8. I want to half its value on every iteration (10e-4 on second iteration). How to do it?
maxiter = 100;
while iter< maxiter
gamma = 1Oe-8
f = gamma * p;
end
4 commentaires
madhan ravi
le 12 Fév 2019
What's p and what's the desired output ?
OCDER
le 12 Fév 2019
" half its value on every iteration (10e-4 on second iteration) "
This is a confusing statement. Do you want to half it's value?
(10e-8) / 2 = 5e-9
OR
Do you want to increase the power value by half the value?
10e-8 , 10e-4, 10e-2, 10e-1, 10e-0.5 ?
Ahmad Hasnain
le 12 Fév 2019
Ahmad Hasnain
le 12 Fév 2019
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Gamma Functions dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!