### If a is an m by n rectangular matrix with m gt n and if c

Assignment Help Applications of MATLAB
##### Reference no: EM13347769

If A is an m by n rectangular matrix with m >= n and if c is a vector with n components then A c = y can not usually be solved exactly.  Matlab can solve these equations approximately with the command c = A \ y.   The solution c is called the "least squares" solution for reasons that we will describe later in the course.  To illustrate an application involving this use of a rectangular matrix suppose that we wish to fit the three points (0,3),  (2,5), and (4,6) with a straight line.  Then as we described earlier we can let the line be described by c1' + c2 x, let c = [ c1 ; c2] (using Matlab notation for vectors), let y = the vector of y values.and let A be a Vandermonde matrix with components aij= xIj-1 .  To fit the line to the data we need to try to solve the equation  A c = y..  In this example one can create A with the Matlab command A = [ 1 0;1 2;1 4] and y with y = [3 ; 5; 6].  Then c = A \ y gives c = [3.1667; .75].  The commands

x=[0; 2; 4]                 % x isthe vector of x coordinates

plot(x,y,'o',x,A*c)     % note that A*c generates points on the best fit line

xlabel('x')

ylabel('y')

title('given points (o) and least squares fit (line)')

will plot the given points and the line 3.1667  + .75 x.  See the figure below.

For homework consider the points (0,0), (1,2), (2,3), (3,9), ( 4,17), (5,24), (6,37). (1) Use Matlab to find the least squares best fit with a line.  Turn in A, y and c and a plot like the one above.  Also (2) use Matlab to find the least square best fit with a quadratic.  Turn in the same information.

#### Questions Cloud

 Problem1 1 using if filter the data for these students : problem1 1. using if filter the data for these students into a column which contains the heights of only female Global finance inc gfi is a financial company that manages : global finance inc. gfi is a financial company that manages thousands of accounts across canada the united states and I health economic theory and practice- based on your work : i. health economic theory and practice- based on your work experience expertise or the field of interest select a Problem 1a researcher is interested in evaluating whether : problem 1a researcher is interested in evaluating whether there is a relationship between number of packs of cigarettes If a is an m by n rectangular matrix with m gt n and if c : if a is an m by n rectangular matrix with m gt n and if c is a vector with n components then a c y can not usually be Problem1 the data below shows the number of absences x and : problem1 the data below shows the number of absences x and the final grade y of seven students in the statistics Question 1consider the problem of operating a warehouse by : question 1consider the problem of operating a warehouse by buying and selling the stock of a certain commodity in order Create a multi-threaded competition in which opposing robin : create a multi-threaded competition in which opposing robin hoods will attack one another and try to take each others In gas-shy-solid fluidization it is frequently common to : in gas-shy-solid fluidization it is frequently common to have a wide size distribution of particles present in the

### Write a Review

#### Problem consider a trapezoidal piece of polymer film as

problem consider a trapezoidal piece of polymer film as shown below. the parallel sides of the trapezoid are insulated

#### In a shell-and-tube heat exchanger one fluid passes through

in a shell-and-tube heat exchanger one fluid passes through a central tube while another fluid flows through an outer

#### 1 we want to find the integral of a function at an

1. we want to find the integral of a function at an arbitrary location x from the origin.nbsp thuswhere ix0 is the

#### Write a matlab function speed planetary n emesh first last

write a matlab function speed planetary n emesh first last arm that computes the speed of a given link in a

#### 1 this problem is intended to demonstrate some problems

1. this problem is intended to demonstrate some problems that can arise from the finite precision of numerical

#### Create the following graph which contains a piecewise

create the following graph which contains a piecewise function where a line exists in the first interval a parabola in

#### 1 given the following actual cpu burst for a tasknbsp 6 4 6

1. given the following actual cpu burst for a tasknbsp 6 4 6 4 13 13 13 and an initial best guess at the burst as 10

#### Problem 1nbsp use matlab to answer the following system of

problem 1.nbsp use matlab to answer the following system of linear equations2x y 3z 1 2x 6y 8z 3 6x 8y 18z 5

#### Implementation in matlab under windows to open a named pipe

implementation in matlab under windows to open a named pipe and to read data from the pipe an other program writes into

#### P1 write the commands that will create the following matrix

p1 write the commands that will create the following matrix. you can use only special matrix commandsp2 two cars

#### 1 let pnx be the lagrange interpolating polynomial of

1. let pnx be the lagrange interpolating polynomial of degree at most n that satis?es pnxi yi i 0 1 2 . . . n.write

#### Q1 filter function form is y myfilterxba where x is

q1 filter function form is y myfilterxba where x is input y is output and a and b are the iir and fir

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!