MATLAB: Debugging

debugging

function E = kepler (e, M)
% E = kepler(e, M)
% Solves kepler's equation for E, the eccentric anomoly given
% e, the orbital eccentricity and M, the mean anomoly.
for i = 1:length(M)
E(i) = fzero(@func, 1);
end
function out = func(E)
out = E - e*sin(E)-M(i);
end
end
the goal is to solve keplers equation using the zero function but I keep getting Error messages in return

Best Answer

kepler(exp(1),4)
kepler(exp(1),magic(4))
works for me...
Related Question