Modify the newton.m function file to create a new m-file that extends Newton\'s
ID: 2968798 • Letter: M
Question
Modify the newton.m function file to create a new m-file that extends Newton's method to a system of 2 equations in two unknowns {f(x,y)=0, g(x,y)=0}. Use the problems suggested in the textbook about Newton's method for 2-by-2 systems. Test your new m-file by applying it to f(x,y)=x^2+y^2-25=0
g(x,y)=x^2-y-2=0
Your example must be a 2-by-2 system of the kind that is not solvable by pencil-and-paper methods. Among other things, for your example you will need to build (in addition to the file that you create about Newton's method for 2-by-2 systems) 6 function files for the 2 functions f and g and for all their first derivatives with respect to x and with respect to y (fx, fy, gx, gy).
Must consist of four parts: Part A -- mathematical description of your work, in detail, with all formulas and diagrams; Part B -- the complete text of all the m-files you had to use; Part C -- a diary file showing the implementation of your m-files; Part D -- all figure files (with adequate explanations), if and when figures are appropriate.
Explanation / Answer
function [peaks,peak_indices] = find_peaks(row_vector) A = [0 row_vector 0]; j = 1; for i=1:length(A)-2 temp=A(i:i+2); if(max(temp)==temp(2)) peaks(j) = row_vector(i); peak_indices(j) = i; j = j+1; end end endRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.