Need Help ?

Home / Expert Answers / Other / graphing-a-sine-wave-on-matlab-a5-assignment-5-graphing-a-sine-wave-in-matlab-now-we-will-use-matlab

(Answered): graphing a sine wave on MATLAB.... (A5) Assignment #5: Graphing a sine wave in Matlab Now we will us ...



graphing a sine wave on MATLAB....
(A5) Assignment #5: Graphing a sine wave in Matlab Now we will use Matlab to plot a sine wave. Think of the sine wave as an oSine Wave Graph 2 Sine Values (Radians) -2 -3 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Time (s)
(A5) Assignment #5: Graphing a sine wave in Matlab Now we will use Matlab to plot a sine wave. Think of the sine wave as an ocean wave or electrons moving through a wire. The sine wave has an amplitude, A, and a frequency, F, (no. of cycles per second). The wave's angle is moving with an angular frequency, w=2*pi*F. Recall, if there are not enough points in time (called sample points), the sine wave will not be smooth. Below is what to type into the m-file editor of Matlab. Note below the percentage sign % is a comment line and is not executed by the Matlab engine. Matlab lines of code to be written in the m-file editor (as a script file) t = 0:0.01:1; % t is the duration or length of time in which the wave is shown and plotted. Time starts at zero and ends at 1 second. But the intervals (samples) occur every 0.01 seconds (10 milliseconds) F = 15; % F is the number of cycles per second A = 4; % strength of the wave y = A*sin(2*pi*F*t); % the equation y that equals A times the sine of (2pift). Check the units of 2*pi*F*t. We multiply pi times F times t to get units of radians: pi (2n)*(cycle/sec)*(sec) plot(t,y) Label all axes and titles appropriately. Upload your m-file (lines of code) The m-file will produce the plot. Make sure m-file has your name on it. Remember 'presentation' (i.e. neatness, clarity, creativity) of your work is worth points. Question: What happens to the Matlab plot when F is changed to 10 Hertz? Write short answer as a comment in your script file Sine Wave Graph 2 Sine Values (Radians) -2 -3 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Time (s)


We have an Answer from Expert

View Expert Answer

Expert Answer


Answer to (A5) Assignment #5: Graphing a sine wave in Matlab Now we will use Matlab to plot a sine wave. Think of the sine wave as...

The Problem has Answer!

We have detailed solutions for you for more understanding.

View Answer