How to half the value of a constant inside an iteration?
Show older comments
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 Comments
madhan ravi
on 12 Feb 2019
What's p and what's the desired output ?
OCDER
on 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
on 12 Feb 2019
Ahmad Hasnain
on 12 Feb 2019
Accepted Answer
More Answers (0)
Categories
Find more on Gamma Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!