The function below returns a value for mu that is always equal to “result” instead of the result of the division. Why am I missing for division to work properly?
for k = 0:10
result = func1(.95,k);
plusone = func1(.95,(k+1));
fprintf('plusone = %f result = %f\n', plusone, result);
mu = double(plusone)/double(result);
fprintf('mu = %f\n', mu);
end
The code for func, if it helps, is:
function result = func1(c, k)
exp = 2^k;
result = c^exp;
There is no error.
mushould always be equal toresultbecause