I want to change value of a variable after every 10 iterations
7 views (last 30 days)
I am doing 100 iterations. I have a variable gamma that multiplies with a vector a. I want to update the value of gamma after every 10 iterations. I wrote a For loop but I can't seem to figure out how to update it after every ten iterations.
iter = 0;
iter = iter + 1;
a = vector;
constt = sqrt(10);
gamma = 10^-8;
for k = 1:10
f(?) = gamma(?) * a'*(1-a);
gamma(k+1) = constt * gamma(k);
I need to calculate f with different values of gamma after every 10 iterations. I am not sure what will be the indexing for f and gamma in the equation.