Lab 4 DS412 20250405
Lab 4 DS412 20250405
Objective: This lab explores the transformation of vectors under a change of coordinates and
analyzes their representations in different bases. This includes deriving transformation matrices and
visualizing the effects of coordinate changes in R2 spaces.
Background
1. In a vector space V with a basis B = {v1 , v2 , . . . , vn }, any vector v can be uniquely expressed
as a linear combination of the basis vectors:
v = a1 v1 + a2 v2 + · · · + an vn
The coefficients [a1 , a2 , . . . , an ] are called the coordinates of v in basis B. The standard
basis is assumed if no basis is mentioned.
2. Coordinate Change Matrix: If β = {w1 , w2 , . . . , wn } is a basis, the matrix S formed by
placing the basis vectors as columns is called the coordinate change matrix. The coordinates
of v in basis β are found by:
[v]β = S−1 v
Lab Questions
1. Understanding Coordinate Changes:
Consider the standard basis vectors in R2 , and let the vector v = [3, 4] be represented in the
standard basis. You are given a new basis:
B = {v1 , v2 } , where v1 = [−1, 0], v2 = [0, 1].
(a) Change of Coordinates in Basis B: Compute the coordinates of v in the new basis B.
(b) Visualizing the Transformation: Use MATLAB to:
• Plot the vector v in the standard basis.
• Plot the vector v in the new basis B.
• Use subplots to display the vector in both representations side by side for comparison.
(c) Verify the Transformation: Compute the change of the basis matrix from the standard
basis to B in MATLAB. Use matrix multiplication to transform v and verify that the result
matches the coordinate representation and plot.
2. Consider the standard basis vectors in R2 , and let the vector x = [3, 2] be represented in the
standard basis. You are given a new basis:
β = {w1 , w2 } , where w1 = [1, −1], w2 = [1, 1].
(a) Change of Coordinates in Basis β: Compute the coordinates of x in the new basis β.
(b) Visualizing the Transformation: Use MATLAB to:
• Plot the vector x in the standard basis.
• Plot the vector x in the new basis β.
• Use subplots to display the vector in both representations side by side for comparison.
(c) Verify the Transformation: Compute the change of basis matrix from the standard
basis to β in MATLAB. Use matrix multiplication to transform x and verify that the result
matches the coordinate representation and plot.
3. Analysis and Interpretation: After completing the visualizations and verifying the results:
(a) Explain how the vector representation changes on each basis.
(b) Reflect on how the orientation and length of the vector shift when the basis changes.
1
Submission Guidelines: Follow these simple steps for lab assignment submission:
1. Submit a lab report (PDF on LMS) and MATLAB code (.m files on MATLAB Grader).
2. The report must include well-structured documentation covering Setup, Results, and Inferences.
3. Ensure originality in both the report and code. Plagiarism is strictly prohibited and will result
in penalties.