Question: Please solve this problem in matlab. Problem [3]. Generating Legendre polynomials: a. Define a polynomial structure with a constructor that starts as function pf makePolyStruct

Please solve this problem in matlab.Please solve this problem in matlab. Problem [3]. Generating Legendre polynomials: a.

Problem [3]. Generating Legendre polynomials: a. Define a polynomial structure with a constructor that starts as function pf makePolyStruct (pc) % Polynomial structure from a vector array pc % that represents a polynomial p (x) % pf.val function handle such that pf.Val (x) -p(x) % pf.a function handle such that pf.d(x) -p, (x) % pf.coeff = pc % pf, roots roots of p (X) Complete this function. b. Legendre polynomials are polynomials defined recursively as: . Po(x) = 1, pi (z) = z, so that, for example, the next three polynomials in this sequence are Pa)83), and ps(530+3) Define a function that generates a "Legendre structure array" that starts as: function Lg-Legendre (n) % Generate Legendre polynomials up to order n % Lg - structure array containing polynomial structures % representing Legendre polynomials up to order n % Lg(k+1) is the "PolyStruct" representation of Pk(z). Complete this function c. Write a function that produces for any given n and any given polynomial q(x), the n + 1 values, r) dx for j-0,1,...,n Your function should be called with the format: an Legint (q, n) where n is a positive integer, q is the "PolyStruct" representation of q(x) an -[ao ai .an Problem [3]. Generating Legendre polynomials: a. Define a polynomial structure with a constructor that starts as function pf makePolyStruct (pc) % Polynomial structure from a vector array pc % that represents a polynomial p (x) % pf.val function handle such that pf.Val (x) -p(x) % pf.a function handle such that pf.d(x) -p, (x) % pf.coeff = pc % pf, roots roots of p (X) Complete this function. b. Legendre polynomials are polynomials defined recursively as: . Po(x) = 1, pi (z) = z, so that, for example, the next three polynomials in this sequence are Pa)83), and ps(530+3) Define a function that generates a "Legendre structure array" that starts as: function Lg-Legendre (n) % Generate Legendre polynomials up to order n % Lg - structure array containing polynomial structures % representing Legendre polynomials up to order n % Lg(k+1) is the "PolyStruct" representation of Pk(z). Complete this function c. Write a function that produces for any given n and any given polynomial q(x), the n + 1 values, r) dx for j-0,1,...,n Your function should be called with the format: an Legint (q, n) where n is a positive integer, q is the "PolyStruct" representation of q(x) an -[ao ai .an

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!