You are on page 1of 1

Ismaeil mohamed 152009

Homework (1)

Function file:
function f=equation(x) f(1)=x(1)^3-3*x(1)*x(2)^2;
f(2)=x(1)^2-4*x(1)^2*x(2);
end

Script file:

%initial value x0=[2,1];


x=fsolve(@equation,x0);
fprintf('the value of x(1)= %5.2f\n',x(1)) fprintf('the
value of x(2)= %5.2f\n',x(2))

command window:

You might also like