MATLAB: How to solve three non-linear equations having 3 unknowns in MATLAB

non-linear equation

My non-linear equations are—
cos(a)-cos(b)+cos(c)=0.725
cos(5a)-cos(5b)+cos(5c)=0.5
cos(7a)-cos(7b)+cos(7c)=0.5

Best Answer

Use the Optimization Toolbox fsolve function:
% MAPPING: x(1) = a, x(2) = b, x(3) = c
fcn = @(x) [cos(x(1))-cos(x(2))+cos(x(3)) + 27.27; cos(5*x(1))-cos(5*x(2))+cos(5*x(3)) - 0.5; cos(7*x(1))-cos(7*x(2))+cos(7*x(3)) - 0.5];
x0 = [1; 1; 1];
[x, fv] = fsolve(fcn, x0);
Be sure to see the documentation for optimoptions and specifically MaxFunEvals, since fsolve encountered that limit before it was happy with the solution (assuming one exists).