Question: Requires MATLAB. Can anyone please help with the code for exercises 1-3? Thanks :) webdav/pid-19305825-dt-content-rid-138615380 1/courses/2018FallB-X-MAT343-92479/MA MATLAB Notes . Transposition is denoted by prime (i.e.
webdav/pid-19305825-dt-content-rid-138615380 1/courses/2018FallB-X-MAT343-92479/MA MATLAB Notes . Transposition is denoted by prime (i.e. a single quotation mark): XT is denoted by X," The triangular systems obtained from the Cholesky decomposition must be solved using the MA LAB "backslash" command. For example, to solve UT w = z, type w-U'lz. a. "2 (component-wise exponentiation). When building the matrix X you should use the special matrix ones . Given the vector a = [a1 , a2, . . . . an]T, you can forn the vector [of, a2, . . . , aarr with the express Example 1: Least Squares fit to a Data Set by a Linear Function. Compute the coefficients of the best linear least-squares fit to the following data. x 2.4 3.6 3.6 4.1 4.75.3 y | 33.8 34.7 35.5 36.0 37.5 38.1 Plot both the linear function and the data points on the same axis system. Solution We can solve the problem with the following MATLAB commands [2.4;3.6;3.6:4.1:4.7;5.3); [33 . 8 ; 34.7:35 . 5 ; 36 . O ; 37 . 5:38.1); % build vector of y-values [ones (size (x)),x) ; % build the matrix X for linear model X'*y ; % build vector of x-values x- y = X = z = % right hand side of the Normal Equations % Left hand side of the Normal Equations
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
