Task 9.1. Create a program that will take a vector\'s x and y components Px and
ID: 1288842 • Letter: T
Question
Task 9.1. Create a program that will take a vector's x and y components Px and Py and returns the proper polar form, with the angle in degrees. Note: the program should determine the proper quadrant that the vector is placed in. Test your program for several vectors to make sure it works, documenting the results of your tests. Task 9.2. Write a program that calculates your grade for this course from the score out of 100, for example a 92 is an ''A''. You should use the syllabus given to you the first day of class to find the grading scale. Note that the disp command is very handy at displaying strings in the MATLAB command window. Task 9.3. The height above the launching pad of the following rocket shown in Fig. 9.5 is known to be of the form, h(t) = k1t - k2t^2 ft. Write a program that will determine the reasonable times at which the rocket is at a given height h.Explanation / Answer
======START OF CODE (PROBLEM 1) ==========
close all
clear all
clc
X = str2double(input('Enter X component: ','s'));
Y = str2double(input('Enter Y component: ','s'));
[THETA,RHO] = cart2pol(X,Y);
disp('Polar angle theta is:');
disp(THETA*57.2957795);
disp('Polar radius r is:');
disp(RHO);
if(THETA*57.2957795>-180 && THETA*57.2957795 <-90)
disp('Vector lies in third quadrant');
break;
elseif(THETA*57.2957795>-90 && THETA*57.2957795<0)
disp('Vector lies in fourth quadrant');
break;
elseif(THETA*57.2957795>0 && THETA*57.2957795<90)
disp('Vector lies in first quadrant');
break;
elseif(THETA*57.2957795>90 && THETA*57.2957795<180)
disp('Vector lies in second quadrant');
break;
elseif(THETA*57.2957795==0)
disp('Vector lies on positive X axis');
break;
elseif(THETA*57.2957795==90)
disp('Vector lies on positive Y axis');
break;
elseif(THETA*57.2957795==180)
disp('Vector lies on negative X axis');
break;
elseif(THETA*57.2957795==-90)
disp('Vector lies on negative Y axis');
break;
end;
=======END OF CODE==============
======START OF CODE (PROBLEM 3) ==========
close all
clear all
clc
H = str2double(input('Enter height: ','s'));
h = H-3;
b = 64;
a = -16;
c = h;
x1 = (-b + sqrt(b^2 - 4 * a * c))/(2*a)
x2 = (-b - sqrt(b^2 - 4 * a * c))/(2*a)
if(x1>=0)
disp('Time (in seconds)');
disp(x1);
end
if(x2>=0)
disp('Time (in seconds)');
disp(x2);
end
=========end of code===========
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.