MATLAB: Devi method of finding root

plz find the attachment and
help me in executing this program

Best Answer

Dear Unhappy, here is the solution if I understood your problem correctly:
syms a_sym b_sym
x_sym = a_sym + 1j * b_sym;
a = 1;
b = 2;
e = 2.71828;
tol = 1e-5;
da = e + a;
db = e + b ;
count = 0;
while (~(abs(da) < tol) && ~(abs(db) < tol))
f = double(subs(x_sym, [a_sym b_sym], [a b]));
realF = real(f);
imagF = imag(f);
da = (realF * realF + imagF * imagF) / abs(f^2);
db = (realF * realF - imagF * imagF) / abs(f^2);
a = a - da;
b = b - db;
count = count + 1;
if (count > 400)
fprintf('Error...! Solution not converging !!! \n'); % printing the error message
break;
end
end
if (count < 400)
fprintf('The solution = ');
fprintf('\nNumber of iteration taken = %d\n',count);
end