lab4 - Math 250 MATLAB Lab Assignment#4 Diaa Khalil rand'seed,6682 Question 1(a A = rmat(3,2 A = 5 4 8 0 9 2 u = A,1 v=A,2 u = 5 8 9 v = 4 0

# lab4 - Math 250 MATLAB Lab Assignment#4 Diaa Khalil...

• Lab Report
• 7
• 89% (27) 24 out of 27 people found this document helpful

This preview shows page 1 - 3 out of 7 pages.

% Math 250 MATLAB Lab Assignment #4% Diaa Khalilrand('seed',6682)% Question 1 (a)A = rmat(3,2)A =5 48 09 2u = A(:,1), v=A(:,2)u =589v =402[s,t]=meshgrid((-1:0.1:1), (-1:0.1:1));X = s*u(1)+t*v(1); Y = s*u(2)+t*v(2); Z = s*u(3)+t*v(3);surf(X,Y,Z); axis square; colormap hot, hold on% Question 1 (b)b = rvect(3)b =487r = -1:0.5:1;plot3(r*b(1),r*b(2),r*b(3), '+')% Question 1 (c)z = rand(2,1), c=A*zz =0.01770.0940c =0.46460.14190.3476figure, surf(X,Y,Z); axis square; colormap hot, hold onplot3(r*c(1),r*c(2),r*c(3), '+')% Question 1 (d) % The equation Ax = b is not solvable because the entire line Span(b) does not lie% on the graph of the column space Col(A).% Question 1 (e) % The equation Ax = c is solvable because the entire line Span(c) lies% on the graph of the column space Col(A).% Question 2B = rmat(3,3), rank(B)B =5 5 75 9 06 7 0ans =3A=[B(:,1),B(:,2),2*B(:,1)+3*B(:,2),4*B(:,1)-B(:,2),B(:,3)], R=rref(A)A =5 5 25 15 75 9 37 11 06 7 33 17 0R =1 0 2 4 00 1 3 -1 00 0 0 0 1
% Question 2 (a)% The pivot columns of R will be those columns of A that are not linear combinations% of any other column of R. By the Column Correspondence Property,if column j ofR is a % linear combination of other columns of R, and R is the reduced row echelon form of % matrix A, then column j is a linear combination of the corresponding columns of A using % the same coefficients. Therefore, because columns 3 and 4 of A are linear combinations % of columns 1 and 2 of A, the pivot columns of A (and R) will be the other columns: % columns 1, 2, and 5.
• • • 