{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Midterm 1 Practice Problems

Midterm 1 Practice Problems - University of California...

Info icon This preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
University of California, Berkeley College of Engineering Fall Semester 2005 Professor R. Dibble and R. Horowitz E77 Midterm Examination I Monday September 26, 2005 Name : SID : Section: 1 2 (Please circle your lecture section) Please circle your Laboratory section: (where your exam will be returned) #11: TuTh 8-10 #12: TuTh 10-12 #13: TuTh 12-2 #14: TuTh 2-4 #15: TuTh 4-6 #16: MW 8-10 #17: MW 10-12 #18: MW 2-4 #19: MW 4-6 Part Points Grade 1 10 2 14 3 12 4 14 5 8 6 4 7 10 8 8 TOTAL 80 1. Write your name on each page. 2. Record your answers ONLY on the spaces provided. 3. You may not ask questions during the examination. 4. You may not leave the room before the exam ends. 5. Close book exam. One 8 . 5 × 11 sheet of handwritten notes allowed. 6. No calculators or cell phones allowed. (Please turn cell phones off) 1
Image of page 1

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

View Full Document Right Arrow Icon
E77 Midterm I, Fall 2005 NAME: 1 Part What is the output when the following commands are typed in sequence from the MATLAB command window? Do not worry about the exact format of the output. 1. (2) >> clear all >> x = 4*2/4+(-2)ˆ2; >> x = 2. (2) >> y = 4*(2\4)-2ˆ(2); >> y = 3. (2) >> y = floor(3.2)+log(exp(2)); >> y = 4. (2) >> z =5*sin(pi/2)+sqrt(9); >> z = 5. (2) >> who Numbers between parenthesis are the points allocated to each question. page 2/10
Image of page 2
E77 Midterm I, Fall 2005 NAME: 2 Part Assume that the following commands have been entered into the MATLAB command window: >> clear all >> a = 2; >> b = [1;4]; >> c= [1 2]; Write the output that the following commands will produce. Do not worry about the exact format of the output. If the result produces a Matlab error then write ERROR. 1. (2) >> a + b ans = 2. (2) >> a .* c ans = 3. (2) >> a * c ans = 4. (2) >> c .ˆ a ans = 5. (2) >> b + c ans = 6. (2) >> b’ + c ans = 7. (2) >> c .ˆ (b’) ans = Numbers between parenthesis are the points allocated to each question. page 3/10 This material has not yet been covered in F'07
Image of page 3

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

View Full Document Right Arrow Icon
E77 Midterm I, Fall 2005 NAME: 3 Part 1. What is the output when the following commands are sequentially typed from the MATLAB command window? Do not worry about the exact format of the output. (a) (1) >> s = ’Are you asleep yet?’; >> length(s) = (b) (2) >> s([5 7 14]) = (c) (3) >> s(16 : -3 : 9) = 2. Fill in the blanks, exactly as you would in Matlab, to create two vectors, V and W , each having 101 elements and ranging from π/ 2 to π/ 2. (3) >> V = linspace( ); (3) >> W = [ : : ]; Numbers between parenthesis are the points allocated to each question. page 4/10
Image of page 4
E77 Midterm I, Fall 2005 NAME: 4 Part Assume that the matrix A = 1 6 5 4 2 9 8 0 7 has been defined, i.e. >>A = [1 6 5; 4 2 9; 8 0 7]; . Write the output that the following commands will produce. Do not worry about the exact format of the output. If the result produces a Matlab error then write ERROR.
Image of page 5

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

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern