MATLAB: Increasing the arbitrary constant in newton's method
Favorites|Homepage
Subscriptions | sitemap
HOME > Mathematics > MATLAB: Increasing the arbitrary constant in newton's method

MATLAB: Increasing the arbitrary constant in newton's method

[From: ] [author: ] [Date: 11-10-02] [Hit: ]
Id appreciate it if someone could tell me where Im going wrong?for C==5:0.f=(0.plot(C,......
have Newton's Method working, but the second part of the question asks;
'Now use your Newton's method code to calculate the root for a range of values of C from C=-5 to C=5 in steps of 0.5. Plot the root obtained for different values of C.
I have used nested FOR loops to try and answer the problem, but nothing is coming up on my graph. The code is just below, I'd appreciate it if someone could tell me where I'm going wrong? Thanks =)

x0=-8;
x=x0;
N=5

for C==5:0.5:5

for N=1:5
f=(0.5*x^2)+(4*x)+(3*cos(x))+C;
df=x+4-sin(x);
x=x-(f)/(df)
end
solution=x
end

plot(C,solution)

-
plot
must be into the loop
i think x must be ploted
1
keywords: Increasing,newton,MATLAB,method,039,arbitrary,in,constant,the,MATLAB: Increasing the arbitrary constant in newton's method
New
Hot
© 2008-2010 http://www.science-mathematics.com . Program by zplan cms. Theme by wukong .