{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

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 (x>12 & x<135) printf( " X is less than 135 and greater than 12. " ); end 3.7 response = 1;

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

View Full Document
while (response ~= 0) beep disp( 'Well hello there!' ) response = input( 'Enter a number > 1 to repeat, Enter 0 to stop' ); end int response ; int sum ; response= 1;
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern