Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,162,474 members, 7,850,631 topics. Date: Wednesday, 05 June 2024 at 06:27 AM

Help: Forumites Please Help Write this Matlab Program. - Software/Programmer Market - Nairaland

Nairaland Forum / Science/Technology / Programming / Software/Programmer Market / Help: Forumites Please Help Write this Matlab Program. (778 Views)

Need: Experienced Professional C or C++ Programmer with Matlab experience / Hire Experienced MATLAB, Visual Basic, C, C++, Java Programmers For Projects / Hire Experienced MATLAB, Visual Basic, C, C++, Java Programmers For Projects (2) (3) (4)

(1) (Reply) (Go Down)

Help: Forumites Please Help Write this Matlab Program. by Adonis4u: 11:11pm On Sep 17, 2013
Write a Matlab program, following the coding standard, that takes as input (the coefficients of ) an nth-degree polynomial and a starting point, and which then uses Newton-Raphson’s method to find the nearest stationary point of the polynomial . The program should
consist of precisely the following (not more, not less):

• A function NewtonRaphson (in the file NewtonRaphson.m) that takes as input
(i) a vector containing the coefficients of the polynomial considered,
(ii) a starting point, and
(iii) a tolerance parameter (for checking convergence), and
then executes the main iteration loop while storing the iterates xj , j = 0, 1, . . ..
After converging (i.e. when |xj+1−xj | < T, where T is the tolerance parameter)
the function should return a vector containing the iterates with the stationary
point as the last element in that vector.

• A function Polynomial (in the file Polynomial.m) which takes x and the n+1
coefficients of an nth-degree polynomial a0, a1, . . . , an as input, and returns the
value f(x) = a0 + a1x + . . . + anxn.

• A function PolynomialDifferentiation (in the file PolynomialDifferentiation.m)
which takes the n+1 coefficients of an nth-degree polynomial a0, a1, . . . , an and
the order k of the derivative as input and returns the n + 1 − k coefficients of
the kth derivative of the polynomial.
Example: if the input polynomial is 1 + 2x + 3x2 and k = 1, the input coeffi-
cents are (1, 2, 3), and the output coefficients should be (2, 6) If, instead, k = 2,
the output coefficients should instead be (6) (a vector with one element). If
k = 3, an empty vector should be returned.

• A function NewtonRaphsonStep (in the file NewtonRaphsonStep.m) which car-
ries out a Newton-Raphson iteration step as in taking xj , f'(xj) and f''(xj) as input, and returning xj+1.

• A function PlotIterations, which should be called after the end of the main
loop, and which plots the polynomial (in an appropriate range, both in the
horizontal and vertical directions) as well as the iterates (as circles) xj , j =
0, 1, . . ..

• A main script Main.m that defines the polynomial coefficients and starting
point, calls the NewtonRaphson function with these parameters and finally
calls PlotIterations as in the following example:
polynomialCoefficients = [10 -2 -1 1]; % Defines the polynomial 10 - 2x - x^2 + x^3
startingPoint = 2;
tolerance = 0.0001;
iterationValues = NewtonRaphson(polynomialCoefficients, startingPoint, tolerance);
PlotIterations(polynomialCoefficients,iterationValues);

Thanks in anticipation.
Re: Help: Forumites Please Help Write this Matlab Program. by Nobody: 10:19am On Sep 24, 2013
Nairaland programmers are php and java freaks. Try http://www.stackoverflow.com Learn here if u have time.
http://www.tutorialspoint.com/matlab/index.htm
Re: Help: Forumites Please Help Write this Matlab Program. by Adonis4u: 7:38pm On Sep 24, 2013
paddy4destiny: Nairaland programmers are php and java freaks. Try http://www.stackoverflow.com Learn here if u have time.
http://www.tutorialspoint.com/matlab/index.htm

Thanks Paddy, I''ll check it out.
Re: Help: Forumites Please Help Write this Matlab Program. by llbhuds: 10:58pm On Oct 23, 2013
@op
I live in sweden and i will like to ask you some questions pls
Re: Help: Forumites Please Help Write this Matlab Program. by 0yewale(m): 3:33am On Oct 24, 2013
you can contact me @ danday006@gmail.com

(1) (Reply)

C Programing Language Expert Needed In Here Urgently / Vacancy For Software Developers / Programmers / Php Programmer For Shopping Cart

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 14
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.