Unit 12 Test - UNIT 12 TEST 1. Plot the following three...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: UNIT 12 TEST 1. Plot the following three curves over a time scale of 0:0.01:2: a. A sine wave of amplitude 1 and frequency 5 Hz. b. A cosine wave of amplitude 2 and frequency 3 Hz. c. An exponential curve of e-2t . Vary the colors of the plot suitably showing the differences. Also vary the lines ( like dashed line, dotted lines etc..) Tip: The equation for a sine wave with an amplitude of 7 and a frequency of 12 Hz is y=7*sin(12*2*pi*x). t=0:0.01:2; y=1*sin(10*pi*t); %a z=2*cos(6*pi*t); %b x=(exp(1)).^(-2.*t); %c plot(t,y,'b-',t,z,'g:',t,x,'r--') 2. Compare the the lines produced for the equation y=x 3 exp(x) on a regular plot(x,y) and semilogx(x,y). Use a comment in your code to describe the difference between the two plots. % REGULAR PLOT: x=0:0.1:2; y=(x.^3).*exp(x); plot(x,y) % SEMILOGX: figure(2); x=0:0.1:2; y=(x.^3).*exp(x); semilogx(x,y) % Regular plot gives us the "y vs x graph" simply using the values of x (defined by user) and plots y...
View Full Document

Page1 / 4

Unit 12 Test - UNIT 12 TEST 1. Plot the following three...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online