4. The following parametric equations shown below result in a well-known plot. x
ID: 2326524 • Letter: 4
Question
4. The following parametric equations shown below result in a well-known plot. x(t) = cos(t) 7t y(t) = sin(t) (sin (2) Create a script that uses the menu function to allow the user to select the number of curves to include on one plot. Choices for the number of curves should be: 7, 8,9, 10. As an example, if the user selects7 from the menu then the exponent m in the above equation should range from 1 to 7. You can then generate a plot of 7 curves. Values of t should range from O to 200 in increments of 0.5. Note: you will need to use a for loop to loop through m and construct the y equations. An example for me7 is shown below.Explanation / Answer
Here is the Matlab code:
% Matlab code begins
prompt = 'How many curves do you want? ';
n = input(prompt)
for i= 1:n
t = [0:0.5 :200];
x = cos(t);
y = sin(t).*(sin(t./2)).^i ;
plot(x,y);
hold on;
end
hold off
% Matlab code ends
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.