Question: To plot y = sin(x), we must define vectors of x and y values and then use the plot command. This can be done as

To plot y = sin(x), we must define vectors of x and y values and then use the plot command. This can be done as follows:
x = 0:0.1:6.3; y = sin(x);
plot(x, y)
(a) Let us define a rotation matrix and use it to rotate the graph of y = sin(x). Set
t=pi/4; c = cos(t): s = sin(t); R = [c,-s;s,c]
To find the rotated coordinates, set
Z = R*[x;y]; xl = Z(l,:); yl = Z(2,:);
The vectors xl and yl contain the coordinates for the rotated curve. Set
w = [0. 5]: axis(' square ')
and plot xl and yl using the MATLAB command
plot(xl, yl, w, w)
By what angles has the graph been rotated and in what direction?
(b) Use the rotation matrix R from part (a) to rotate the curve y = - sin(x). Plot the rotated curve. How does the graph compare to that of the curve from part (b)? Explain.

Step by Step Solution

3.44 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a The graph has been rotated 45 in the counterclockwise direction b The grap... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

949-M-L-A-E (941).docx

120 KBs Word File

Students Have Also Explored These Related Linear Algebra Questions!