This preview has intentionally blurred sections. Sign up to view the full version.View Full 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
This note was uploaded on 10/02/2011 for the course ME 205 taught by Professor Koen during the Spring '07 term at University of Texas.
- Spring '07