Question

MATLAB

2. a. Create the vector G- b. Compute the counter-clockwise rotations of the vector a, at angles 45, 90, 130, and 180 degrees using the 2 x 2 rotation matrices. Store all 4 of these results with variable names a-45, a-90, a-130, and a_180. c. On the same figure, using the function plot, plot all 5 vectors a, a-45, a_90, a 130, and a 180, each vector with a different color. You may choose different line styles, but this part is op- tional. d. Add a title of your choice and add axes labels.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

clear
clc
a=[1;0];
R=@(th)[cosd(th) -sind(th);sind(th) cosd(th)];
a_45=R(45)*a
a_90=R(90)*a
a_130=R(130)*a
a_180=R(180)*a

plot([0 a(1)],[0 a(2)],'r')
hold on
plot([0 a_45(1)],[0 a_45(2)],'g')
plot([0 a_90(1)],[0 a_90(2)],'m')
plot([0 a_130(1)],[0 a_130(2)],'b')
plot([0 a_180(1)],[0 a_180(2)],'k')
legend('a','45\circ','90\circ','130\circ','180\circ')
axis([-2 2 -2 2])

xlabel('x')
ylabel('y')
title('Rotated lines')

Add a comment
Know the answer?
Add Answer to:
MATLAB 2. a. Create the vector G- b. Compute the counter-clockwise rotations of the vector a,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please help with these need working not matlab, thanks. 2 y2 = 1 that is in the 1st quadrant with the counter clockwise...

    Please help with these need working not matlab, thanks. 2 y2 = 1 that is in the 1st quadrant with the counter clockwise 4. C is the portion of ellipse 4 rotation. (a) Express the curve C' in the form of r = x(t)i+y(t)j by using polar coordinate and specify the t value at the starting and the ending points. A2 =2 marks F.dr. where F is the vector function F = (x+y)i+(1-x)j. (b) Evaluate the line integral L =...

  • Using Matlab, only need part b to be done thank you. 1. Below you will find...

    Using Matlab, only need part b to be done thank you. 1. Below you will find a table with hours of life of a cupper plate used in an industrial process. They are 45 data samples (they are just an array, but in this document, they are presented in three columns to save space) 63 59 75 78 70 64 75 93 90 70 98 92 85 90 83 95 89 92 92 90 82 81 89 80 79 46...

  • Please help me with this MATLAB programming problem! Im coding iin MATLAB2018 if that makes any d...

    Please help me with this MATLAB programming problem! Im coding iin MATLAB2018 if that makes any difference! The first picture is the question i need to answer. The picture below is used as reference to answer the question. The last picture (below) is the into to the problem, and is used as reference. 1. Use Matlab to create the following single plot with three subplots. All titles, gridlines, and axis labels should be as shown. Arc System Response 15 E...

  • These questions are to be answered using MATLAB. I only need #3 answered, but #1 provides...

    These questions are to be answered using MATLAB. I only need #3 answered, but #1 provides information (like initial velocity, etc.) required for the questions. I think I have it done, but I'd like to see if there are other ways to use MATLAB for this question. PROJECTILES The distance a projectile travels when fired at an angle 8 is a function of time and can be divided into horizontal and vertical distances. Horizontal (1) = 1.V.cos(0) Vertical(t) = 1•...

  • Matlab Question 2. For this problem you have to create a program that defines two vectors...

    Matlab Question 2. For this problem you have to create a program that defines two vectors of numbers: A and B and uses a for-loop to combine the values of A and B. Note that different parts of the question below specify different orders for combining the elements. To start this exercise start a MATLAB script called q2.m and put, at the top, the vector definition: B [11:20] Question 2a: Problem definition Copy the file q2.m to q2a.m. For this...

  • Problem 5 (programming): Create a MATLAB function named lagrange interp.m to perform interpolation using Lagrange polynomials....

    Problem 5 (programming): Create a MATLAB function named lagrange interp.m to perform interpolation using Lagrange polynomials. Download the template for function lagrange interp.m. The tem Plate is in homework 4 folder utl TritonED·TIue function lakes in the data al nodex.xi and yi, as well as the target x value. The function returns the interpolated value y. Here, xi and yi are vectors while x and y are scalars. You are not required to follow the template; you can create the...

  • For this project, each part will be in its oun matlab script. You will be uploading a total 3 m f...

    For this project, each part will be in its oun matlab script. You will be uploading a total 3 m files. Be sure to make your variable names descriptive, and add comments regularly to describe what your code is doing and hou your code aligns with the assignment 1 Iterative Methods: Conjugate Gradient In most software applications, row reduction is rarely used to solve a linear system Ar-b instead, an iterative algorithm like the one presented below is used. 1.1...

  • Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture...

    Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture i sent is the first page 5. Write and save a function Sphere Area that accepts Radius as input argument, and returns SurfaceArea (4 tt r) as output argument. Paste the function code below. Paste code here 6. Validate your Sphere Area function from the command line, checking the results against hand calculations. Paste the command line code and results below. 7. Design an...

  • % PA 08: 3D Plots, Files, Functions % Using the script provided and the functions provided,...

    % PA 08: 3D Plots, Files, Functions % Using the script provided and the functions provided, complete the code % to be able to plot specified graphs. Script file contains a menu of % choices where user will select which plot to produce. % Functions contain the necessary code to plot. Please note that functions % do NOT take any arguments and do NOT return anything. % You are provided with two MS Excel files that you must use to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT