create/save files 2 za .m , moja iite executed.m then pachika
Code:
function F = executed(x,y)
a = 10;
b = 3;
c = 2;
F(1) = (a*x(1))+(b*x(2)*x(2))-b;
F(2) = (x(1)*x(2))-(exp(x(2)))-c;
x(1) inasimama badala ya X na x(2) inasimamama badala ya Y
then create/save file lingine .m liite executer.m then pachika
Code:
fun = @ executed; % jina la file na juu hapo
x0 = [0,0];
x = fsolve(fun,x0)
then kwenye Command Window
jibu:
x =
-1.0144 -2.0932