4 The following parametric equations shown below result in a

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.

Solution

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

 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 funct

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site