MATLAB : Least Squares - Solving Inexactly Specified Equations in an Approximation

The solution can ONLY be accepted in Matlab. The problem is in the attachment file.

Least Square
Planetary orbit [2]. The expression z = a + bxy + cy + dx + ey + f is known
as a quadratic form. The set of points (x, y) where z = 0 is a conic section.
It can be an ellipse, a parabola, or a hyperbola, depending on the sign of
the discriminant b - 4ac. Circles and lines are special cases. The equation
z = 0 can be normalized by dividing the quadratic form by any nonzero
coefficient. For example, if f ≠ 0, we can divide all the other coefficients by
f and obtain a quadratic form with the constant term equal to one. You can
use the Matlab meshgrid and contour functions to plot conic sections. Use
meshgrid to create arrays X and Y. Evaluate the quadratic form to produce
Z. Then use contour to plot the set of points where Z is zero.

(a) Determine the coefficients in the quadratic form that fits this data in
the least squares sense by setting one of the coefficients equal to one and
solving a 10-by-5 overdetermined system of linear equations for the other
five coefficients. Plot the orbit with x on the x-axis and y on the y-axis.
Superimpose the ten data points on the plot.

(b) This least squares problem is nearly rank deficient. To see what effect this
has on the solution, perturb the data slightly by adding to each coordinate
of each data point a random number uniformly distributed in the interval
[-.005, .005]. Compute the new coefficients resulting from the perturbed data.
Plot the new orbit on the same plot with the old orbit. Comment on your
comparison of the sets of coefficients and the orbits.

**Please write comprehensive and interpretive descriptions and comments for code as well.

Matlab is used to evaluate a least-squares problem involving a planetary orbit. The solution is detailed and well presented. The solution was given a rating of "5" by the student who originally posted the question.

1. consider the following subspaces of R^4
V=span{v1,v2,v3}, W=span{w1,w2,w3}
where v1=(1,2,1,-2)^T w1=(1,1,1,1)^T
v2=(2,3,1,0)^T w2=(1,0,1,-1)^T
v3=(1,2,2,-3)^T w3=(1,3,0,-4)^T
a)Find two systems of homogeneous linear equations whose solution spaces are V and W, respectively.
b)Find a basis f

1) Solve {exp(-x)}(1 + x^2) - 0.165=0
a) by use bracket root (h=3) from x_0=0, then use false position
b) by use Newton-Raphson from x_0=1 and x_0 =0 and x_0=3
2) Solve 0.002x^5 - x^2=120
(it is known that the root is greater than 6.0)
a) bracket the root from x_0=6.0 with h=4.0
b) then continue with one use of the

Hi,
I need help in using Matlab to build an m file for
solving non-linear equations using the Newton-Raphson
method (or another recommended method.) I need a clear
explanation of the process of creating an m file, and
also using it to find the roots of the following two
equations as examples:
1) f(x) = exp(-x) - sin(

Please also give Matlab solutions to the following problem.
Find the Pade approximation R_(5,4) (x) for f(x) = sin x. Plot the following graphs:
i) Comparison of R_(5,4) (x) versus f(x) = sin x, and
ii) the error E(x) = |R_(5,4) (x) - sin x|,
each on interval [-PI, PI].

Given a vector X = [ 3, 4, 6 ] and a vector y = [ 2, 3, 1 ]
(a)
polyfit ( x, y, 2 )
returns result
[ -0.666, 5.6667, -9.000 ]
(b)
polyfit ( x, y, 1 )
returns result
[ -0.4286, 3.8571 ]
(c)
polyfit ( x, y, 0 )
returns result
[ 2 ]
The question. I need for you to demonstrate ( i.e show all wor

Using Legendre polynomials of degree 1, 2, and 3, find the least-squaresapproximation
for the function e^(-x) on [2, 4].
I am confused as to how to do this on the interval [2,4] and not [-1,1]
I have included the notes on this section, including an example (see the attached file).

Please find the leastsquares solution of linear system Ax=b, and find the orthogonal projection of b onto the column space of A.
I) Matrix 3*2 A=[1 1;-1 1;-1 2] , b=[7;0;7]
II) A=[2 0 -1;1 -2 2;2 -1 0;0 1 -1] , b=[0;6;0;6]
Answers: I) x1=5, x2=1/2, [11/2;-9/2;-4] II) x1=14, x2=30, x3=26; [2;6;-2;4]
Find the ortho

1. Use loops to create a 3 x 5 matrix in which the value of each element is the difference between the indices divided by the sum of its indices (the row number and column number of the element). For example, the value of the element (2,5) is (2-5) / (2+5) = -0.4286
2. Write the program indicated in the problem and use it to