lab3 - Doug Rivas- M 5-7 ME 218 Lab 3 3.1 size of y= 1x9,...

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

View Full Document Right Arrow Icon
Doug Rivas- M 5-7 ME 218 Lab 3 3.1 size of y= 1x9, each entry of y will be natural log to the powers of 1 through 9. 3.2 The second index of the function is at x = 1.5, which is not an integer 3.3 The first plot command, plot(y), plots length(x) on the x axis with values of 1-11 counting by ones, while the second plot command, plot(x,y) plots x on the x axis with values of 1-6 counting by .5. Both plot commands plot y on the y axis. 3.4 M-File: row = [-2 -1 0 1 2] ; % Our starting values factor = [ 1 10 100 1000 ]' ; % The multiplication factor for each row A(1, 1:5)= row(1,1:5)*factor(1,1); A(2, 1:5)= row(1,1:5)*factor(2,1); A(3, 1:5)= row(1,1:5)*factor(3,1); A(4, 1:5)= row(1, 1:5)*factor(4,1); A % print out the resulting matrix 3.5 M-File: for x= 1:20 %F= Force; if ( x < 0 ) Force = 0 ; elseif ( x <= 10 ) Force = 50 ; else Force = 100 ; end end plot(x, Force) axis( [0 20 0 100]); xlabel([ 'X' ]); ylabel( 'Force' ); title( 'X vs. Force' ); 3.6 if printf( " X is less than 135 and greater than 12. " ); end 3.7 response = 1;
Background image of page 1

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

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

This note was uploaded on 04/07/2008 for the course ME 218 taught by Professor Unknown during the Spring '08 term at University of Texas at Austin.

Page1 / 6

lab3 - Doug Rivas- M 5-7 ME 218 Lab 3 3.1 size of y= 1x9,...

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