Write a MATLAB program called SinCurve to plot one cycle of

Write a MATLAB program called SinCurve to plot one cycle of f(t)=sin(wt) using t = 100 linearly-spaced points from 0 to T, where T is the period of the sine curve.

The period of f(t)=sin(wt) is 2pi/w

The program should prompt the user for the value of w (called angular frequency). The sine curve should be plotted with a green line, and should include a title. For example:

IMPORTANT NOTE: Cody does not display a figure window, However, Cody can test for the correctness of items on the figure window.

Name the input variable w . Place the array of 100 values into an output variable named t .

The output will look like this, for any value of w

Solution

Required Matlab Code for it:

t = [0:1/10:100];
A = 1;
w=100;
y = A*sin(2*pi*t/w);
plot(t(1:100),y(1:100), \'g\')
xlabel(\'Time\'), ylabel(\'Sine wave\')
title(\'Sine Wave vs Time\');
zoom xon;

thank you.

Write a MATLAB program called SinCurve to plot one cycle of f(t)=sin(wt) using t = 100 linearly-spaced points from 0 to T, where T is the period of the sine cur

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site