don't know the problem in my while loop
Mostra commenti meno recenti
there is also another error idk about of :
Array indices must be positive integers or logical values.
Error in sym/subsref (line 890)
R_tilde = builtin('subsref',L_tilde,Idx);
iteration=0;i=1;
x=zeros(100,1);
syms f(x);
f(x) = input('donner une function : f(x)= ');
e = input('donner une la valuer de erreur : e = ');
x(1) = input('donner la valeur de depart : x1 = ');
while ( e < abs(x(i+1)-x(i)) )
iteration = iteration +1 ;
x(i+1)=x(i)-f(x(i))/diff(f(x(i)));
i=i+1;
end
disp('la value de x apartir de e est', x(i));
disp(iteration);
Risposta accettata
Più risposte (1)
hamza kharbouch
il 1 Gen 2022
Categorie
Scopri di più su MATLAB in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!