you can
use Lagrange or Newton interpolation

Write a Matlab program that, given number of points n, does the following:

1) defines n equispaced points xj, j = 1,…,n on the interval [-3,3]
with x1= -3 and xn = 3. (Hint: use Matlab function linspace).

2) defines 2025 equispaced points xxk, k = 1,.., 2025 on the same interval,
with xx1 = -3 and xx2025 = 3.

3) builds an interpolating polynomial that interpolates function f(x) =
sin(2x) at the points xj.

(Hint: the easiest thing to do is to build a Vandermonde matrix — please DO NOT
use function vander() — and solve the Vandermonde system of equations.
You are allowed to use “” to solve this system. Alternatively