How to half the value of a constant inside an iteration?
Mostra commenti meno recenti
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 Commenti
madhan ravi
il 12 Feb 2019
What's p and what's the desired output ?
OCDER
il 12 Feb 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
il 12 Feb 2019
Ahmad Hasnain
il 12 Feb 2019
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Gamma Functions in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!