ENGIN 7 Study Guide - Midterm Guide: Combinatorics, Catalan Number, Linear Interpolation
![](https://new-preview-html.oneclass.com/xMWbKnB0DLaXj8bxV7gGQqvpr74k3ed2/bg1.png)
Exam Date: November 16 E7 Midterm 2, Fall 2012
E7 Midterm Exam 2
NAME :
SID :
SECTION : 1or 2(please circle your discussion section )
LAB : #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 #20: TuTh 10-12∗#21: MW 3-5 ∗#22: TuTh 4-6∗
(please circle your lab section) ∗in Wheeler
Problem Points Points
1 26
2 6
3 22
4 20
5 24
6 12
TOTAL 110
Carefully read and follow these instructions:
1. Write your name on the top right corner of each page.
1. Start answering the exam only when instructed to do so.
2. Record your answers only in the spaces provided.
3. You may not ask questions during the exam.
4. You may not leave the exam room before the exam ends.
5. You may not use any electronic devices.
6. You may use two 8.5×11 sheets (4 pages) of handwritten notes.
7. Count the number of pages before the start of the exam.
There should be 16 pages.
1 of 16
![](https://new-preview-html.oneclass.com/xMWbKnB0DLaXj8bxV7gGQqvpr74k3ed2/bg2.png)
Name: E7 Midterm 2, Fall 2012
1. Assume that the MATLAB script shown immediately below has been executed.
1S(1).name = 'Bob'; S(1).age = 7;
2S(2).name = 'Karen'; S(2).age = 8;
3S(3).name = 'Michael'; S(3).age = 8;
4S(4).name = 'Judy'; S(4).age = 7;
5S(5).name = 'Jeff'; S(5).age = 7;
6S(6).name = 'Linda'; S(6).age = 9;
(a) (2 pts)
On the space provided, write the output of the following MATLAB commands
>> class(S)
ans =
>> size(S)
ans =
Solution:
1>> class(S)
2ans =
3struct
4>>size(S)
5ans =
61 6
Assume that the MATLAB script shown below has been executed.
1T = S(1);
2U = S(3:end);
(b) (4 pts)
On the space provided, write the output of the following MATLAB commands
>> class(T)
ans =
>> size(T)
ans =
2 of 16
![](https://new-preview-html.oneclass.com/xMWbKnB0DLaXj8bxV7gGQqvpr74k3ed2/bg3.png)
Name: E7 Midterm 2, Fall 2012
>> class(U)
ans =
>> size(U)
ans =
Solution:
1>> class(T)
2ans =
3struct
4>> size(T)
5ans =
61 1
7>> class(U)
8ans =
9struct
10 >> size(U)
11 ans =
12 1 4
(continues on the next page)
3 of 16
Document Summary
1 or 2 (please circle your discussion section ) #20: tuth 10-12 #21: mw 3-5 #22: tuth 4-6 . #17: mw 10-12 #18: mw 2-4 (please circle your lab section) E7 midterm 2, fall 2012: assume that the matlab script shown immediately below has been executed. Assume that the matlab script shown below has been executed. On the space provided, write the output of the following matlab commands. Write a two-line matlab script, which when executed, will add by direct assignment another element to the end of s, with name mary and age 13. S(end+1). age = 13; or s(7). age = 13; (e) (4 pts) Write a two-line matlab script, which when executed, will add by direct assignment a eld, named height to "bob" and "karen" in s by using the string "5 ft 8 in" for "bob", "5 ft 3 in". S(2). height = "5 ft 3 in"; (f) (6 pts)