error running the code in while command in bisection method
Afficher commentaires plus anciens
umerfunction='x.^3';
x_lower=0;
x_upper=1;
x_mid=(x_lower+x_upper)/2;
i=0;
while(abs(umerfunction(x_mid))>0.0001)
fx=umerfunction(x_mid);
X=[i,fx,x_upper,x_lower];
disp X;
if(umerfunction(x_mid)*umerfunction(x_upper))<0
x_lower=x_mid;
else x_upper=x_mid;
end
ERROR:
Array indices must be positive integers or logical values.
Error in bisection (line 7)
while(abs(umerfunction(x_mid))>0.0001)
how to solve that issue? i m very frustated now regarding solving this.Thanks and honours in advance
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Function Creation 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!