Question
Newton's method using MATLAB please write the newton metohd function as a code in MATLAB to evaluate the below functions. Files for functions and their
Newton's method using MATLAB
please write the newton metohd function as a code in MATLAB to evaluate the below functions. Files for functions and their dertive are alreay obtained so I only need The newton function. The code i wrote is giving me Error: Character vector is not terminated properly.
not sure why
Function files and their derivtive:
f1.m
function y = f1(x)
% y = x^2-9
y = (x^2)-9;
end
----
df1.m
function [yprime]=df1(x)
% [yprime]=df1(x) computes the derivative of y=x^2-9
yprime=2*x;
end
----
f2.m
function y = f2(x)
y = x^5-x-1;
end
----
df2.m
function [yprime]=df2(x)
% [yprime]=df2(x) computes the derivative of y= x^5- x-1
yprime=5*x^4 - 1;
end
----
f3.m
function y = f3(x)
y = 3*x-exp(-x);
end
----
df3.m
function [yprime]=df3(x)
% [yprime]=df1(x) computes the derivative of y = 3*x-exp(-x)
yprime = 3 + exp(-x);
end
----
f4.m
function y = f4(x)
y = 2*cos(3*x)-exp(x);
end
-----
df4.m
function[yprime]=df4(x)
%% [yprime]=df4(x) computes the derivative of y= 2*cos(3*x)-exp(x)
yprime = - 6*sin(3*x) - exp(x);
end
2-(j) Fill in the following tableStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started