Unit 12 Test

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

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

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

View Full Document
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

## 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.

### 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
Ask a homework question - tutors are online