error running the code in while command in bisection method
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Function Creation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!