Write a matlab script that will solve the system of linear


1. Write a Matlab script that will solve the system of linear equations shown below. This can be done by solving for the vector of unknowns (X) in the equation AX=B where A is the coefficient matrix and B is the vector on the right-hand side. In the script, also include code to verify that the result is correct.

3x - 2y = -1
-x -6y = -5

Figure 1: Results (X) and the solution to the equation to AX = B using X (stored in a variable called B2). B2 is used to verify the results.

2. Now, plot the lines for the equations in part 1. Plot the line for the 1st equation in blue and the line for the 2nd equation in green. Analyze the equations for "x" from 0 to 1 at an interval of 0.01. It should look like the plot shown. Use the data tab to verify your results. Label the "x" and "y" axes and title the figure as shown.

Figure 2: Expected plot.

3. The Fibonacci sequence is defined using the following equation:

fn = fn-1 + fn-2

Given the following initial conditions, write a function that generates the first "n" Fibonacci numbers.

f1 = 1, f2 = 2

Figure 3: Example output.

HINT: you will have to solve for "y" in each equation of part 1 Use a for-loop. Figure 3 shows an example output when n=12.

I. WHAT TO TURN IN (PLEASE READ THIS CAREFULLY)

For this HW, you only need to provide the Matlab code and the answers for the "Work Task" section. You must put the complete Matlab functions/scripts and the answers into a single MS Word doc. Your code must be in text format. Code provided as an image will not be accepted. You must label everything appropriately (i.e., label the code and work task sections). If I can't understand your answers or code, I will assume it is incorrect. Also, please include the cover page in your Word doc.

Attachment:- Mat_Lab_hw.pdf

Solution Preview :

Prepared by a verified Expert
MATLAB Programming: Write a matlab script that will solve the system of linear
Reference No:- TGS01604711

Now Priced at $30 (50% Discount)

Recommended (99%)

Rated (4.3/5)