Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Matlab please. Thanks :) Generate ten data points in MATLAB using the following syn- thax: x = linspace(-1,1, 10); y = 1./(1+5*x.2); Then fit a

image text in transcribed

Matlab please. Thanks :)

Generate ten data points in MATLAB using the following syn- thax: x = linspace(-1,1, 10); y = 1./(1+5*x.2); Then fit a polynomial of degree 9 to this data. Produce a plot where data is plotted as red circles while the polynomial is plotted with a blue line. In order to make the polynomial graph smooth, generate a new, finer grid xx = linspace(-1,1,200); and plot the polynomial on that grid. As your solution, present the MATLAB code and the plot. Also, make a quick observation about the goodness of fit. Generate the following data in MATLAB: x = linspace(0,2*pi,50); y = 2*cos(x)-sin(x) + .1*randn(size(x)); Now pretend that you do not know the coefficients 2 and (-1) in the harmonic. Compute those coefficients by solving an ap- propriate linear system. As your solution, present code and a plot where data is shown as red circles and the fit is plotted as a solid line. To make the line smooth, plot the fit on a finer grid, as in the previous exercise. Generate ten data points in MATLAB using the following syn- thax: x = linspace(-1,1, 10); y = 1./(1+5*x.2); Then fit a polynomial of degree 9 to this data. Produce a plot where data is plotted as red circles while the polynomial is plotted with a blue line. In order to make the polynomial graph smooth, generate a new, finer grid xx = linspace(-1,1,200); and plot the polynomial on that grid. As your solution, present the MATLAB code and the plot. Also, make a quick observation about the goodness of fit. Generate the following data in MATLAB: x = linspace(0,2*pi,50); y = 2*cos(x)-sin(x) + .1*randn(size(x)); Now pretend that you do not know the coefficients 2 and (-1) in the harmonic. Compute those coefficients by solving an ap- propriate linear system. As your solution, present code and a plot where data is shown as red circles and the fit is plotted as a solid line. To make the line smooth, plot the fit on a finer grid, as in the previous exercise

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions