ME218 Lab1 - 0 2 5 7 >> A-D ans = 2 2 1 1 >>...

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

View Full Document Right Arrow Icon
Greg Gangluff gg2593 1/29/08 Lab 1(MATLAB Review) 1- 3dozen is not a valid MATLAB name because it starts with a number instead of a lower or uppercase letter rickywilliams# = 22 , is not a valid variable name due to the # sign. MATLAB variable names can only contain uppercase and lowercase letters, numbers, and underscores. notTrue! = 0 is not a valid variable name due to the # sign. MATLAB variable names can only contain uppercase and lowercase letters, numbers, and underscores. 1.2 - >> bohr_radius = 9.27e-24 bohr_radius = 9.2700e-024 1.3 - >> x = 4e-5 + 3e-3*i x = 1.0 + 0.0030i 1.4 - >> format long, pi ans = 3.141592653589793 1.5 >> format short, t= x^y + w*v - z t = 130.8156 1.6 – The equations (v-150 ^ 1.1/10+x and v-(150 ^ 1.1)/10+x) result in the two same values. 1.7 - >> -3:1.7:10 1.8 - >> M = [ 0 2 3 5; 7 3 8 4] M = 0 2 3 5 7 3 8 4
Background image of page 1

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

View Full DocumentRight Arrow Icon
>> N = [ 1 1 3 4 5 6 9 4 8] N = 1 1 3 4 5 6 9 4 8 1.9 – >>A+D ans =
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 0 2 5 7 >> A-D ans = 2 2 1 1 >> D-B' ans = -7 -7 -6 -6 >> D-77 ans = -78 -77 -75 -74 >> A/2 ans = 0.5000 1.0000 1.5000 2.0000 >> 2*D ans = -2 0 4 6 1.10 – >> M(7) ans = 5 1.11 – >> partofM = M(:, 1:3) partofM = 0 2 3 7 3 8 1.12 – >> size(D) ans = 3 1 >> size(N) ans = 3 3 1.13- Code, plot attached a=0.5; b=-0.5; t=0:0.1:70; for i=1:length(t) x(i)= sin(a*t(i))*exp(b*t(i)); x2(i)= sin(a*t(i))*cos(a*t(i)); v(i)= a*cos(a*t(i))*exp(b*t(i)) + b*sin(a*t(i))*exp(b*t(i)); end plot(t,x, '-' ) 1.14-Code, graph attached a=0.5; b=-0.5; t=0:0.1:70; for i=1:length(t) x(i)= sin(a*t(i))*exp(b*t(i)); x2(i)= sin(a*t(i))*cos(a*t(i)); v(i)= a*cos(a*t(i))*exp(b*t(i)) + b*sin(a*t(i))*exp(b*t(i)); end plot(t,x, '-' ) figure(3); plot( t, x, 'b-' , t, v, 'r:' ); xlabel( 'Time' ); title( 'Position vs. Time and Velocity vs. Time' ); axis( [0 70/3 -.15 .5 ] );...
View Full Document

This note was uploaded on 06/23/2011 for the course ME 218 taught by Professor Unknown during the Fall '08 term at University of Texas.

Page1 / 3

ME218 Lab1 - 0 2 5 7 >> A-D ans = 2 2 1 1 >>...

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

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