Array indices must be positive integers or logical values.
Afficher commentaires plus anciens
y=input('thecomplexvalue of z=');
x=input('therealvalue of z=');
tol=input('the value tolerance tol=');
z=x+1i*y;
funcnew01=z^5+z^3-pi;
funcnew02=diff(funcnew01);
k=0;
if real(z)==0
y=z;
disp('y funcnew01(y) funcnew02(y) k')
disp('........................................')
while abs(funcnew01(y))>tol
y=y-(funcnew01(y)/funcnew02(y));
k=k+1;
end
else
x=z;
disp('x funcnew01(x) funcnew(x) k')
disp('......................................')
while abs(funcnew01(x))>tol
x=x-(funcnew01(x)/funcnew02(x));
k=k+1;
end
end
I get this error in line 20, I'm not shure why I'm trying to make a code for finding the roots of the complex function with the Newton-Raphson method
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Matrices and Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!