Sale!

SOLVED: Math 551 Lab 2

Original price was: $35.00.Current price is: $30.00.

Download Details:

  • Name: lab02-qmsxrj.zip
  • Type: zip
  • Size: 128.34 KB

Category:

Description

5/5 - (3 votes)

TASKS
1. Create a 5 × 5 matrix A using the magic command. Type help magic in the command line to learn
about the magic command.
Variables: A
1
2. Create a column-vector B with entries 1, 3, 2, −1, 4.
Variables: B
3. Create a matrix M by adding the vector B as the last column of the matrix A.
Variables: M
4. Check the rank of A and M using the rank command. Type help rank in the command line to learn
about the rank command.
Variables: rank A, rank M
Q1: Is the system with augmented matrix M consistent?
5. Produce a reduced row echelon form of M by using the rref command. Type help rref in the command line to learn about the rref command.
Variables: rref M
6. Create a 7 × 7 matrix C using the rand command. Type help rand in the command line to learn
about the rand command.
Variables: C
7. Create a row vector D with 7 elements using the rand command.
Variables: D
8. Apply the transpose command to D. Type help transpose in the command line to learn about the
transpose command.
Variables: transpose D
Q2: What does the transpose command do?
9. Create an augmented matrix N of the system with coefficient matrix C and right-hand side D.
Variables: N
10. Apply the rref command to N.
Variables: rref N
11. Consider the system of two equations:
(
x + 2y = 3
x − y = 0
Plot the lines representing each of the equations on one graph using the plot command on the interval
[0, 5]. Use the color red for the first equation and the color blue for the second.
Type in the commands
2 Math 551
1 figure;
2 x = [0:0.1:5];
3 y1=(3-x)/2;
4 y2=x;
5 plot(x,y1,’red’);
6 hold on;
7 plot(x,y2,’blue’);
8 grid on;
Q3: What does the figure command do?
Q4: What does the plot command do?
Q5: What does the hold on command do?
Q6: What does the grid on command do? Type in grid off after grid on to see what will happen.
Q7: Does the system have a solution?
12. Consider the system



2x + y + z = 4
−x + y − z = 1
3x + 2y − z = 6
Note that this system of equations cooresponds to the following augmented matrix:
P =


2 1 1 4
−1 1 −1 1
3 2 −1 6


Type in the commands
1 figure;
2 [x,y]=meshgrid(-5:0.1:5,-5:0.1:5);
3 z1=4-2*x-y;
4 z2=-x+y-1;
5 z3=3*x+2*y-6;
6 surf(x,y,z1);
7 hold on;
8 surf(x,y,z2);
9 hold on;
10 surf(x,y,z3);
Q8: What does the meshgrid command do?
Q9: What does the surf command do?
13. Come up with three systems of linear equations in three variables (with three equations each) representing all possible situations: no solution, a unique solution, infinitely many solutions. For each
system of equations, create the corresponding augmented matrix, respectively naming them no sol,
uni sol, inf sol. Apply the commands above to produce a visual picture for each of the systems (each
on a separate figure). Use appropriate limits for variables x and y and a command view to present
each case clearly.

Variables: no sol, uni sol, inf sol