Pamantasan NG Cabuyao: College of Engineering
Pamantasan NG Cabuyao: College of Engineering
Pamantasan NG Cabuyao: College of Engineering
Medina_
Pamantasan ng Cabuyao Faculty
College of Engineering Checked by: Engr. Anna-liza F. Sigue
Program Head
2nd Semester / A.Y. 2018 – 2019
FINAL EXAMINATION Noted by: Engr. Mary Grace P Beano
Dean
_______
Student Name Section Date Time Score
I. Code analysis and tracing: Analyze the given code and trace the output.
Code Result
1. Explain why this code does what it does. 2. Find a short OCTAVE expression to build the matrix
n = 10;
for j = 1:n
n = n-1;
j
end
4. Give a OCTAVE expression that multiplies two vectors
to obtain
II. Identify the required syntax//function for Octave to perform the required task.
Correct function has been identified 2pts
Correct syntax has been used 1pt
1.Create a Vector that has the following 6. Convert image to binary, black and white, by
elements: [1 2 3 4 5 6 7 8 9 10] threshold.
2.Create column vectors that has the following 7. Convert a grayscale or binary intensity image to an
elements: 1 ,2 ,3 ,4 ,5 respectively. indexed image
3. Read an image as a matrix from the file 8-10.Give the function that would split the image’s color
filename or from the online resource url. to 3 regions on red. blue, green
4. Write images in various file formats.
5. Trace the boundaries of the objects in a binary
image
III. Problem Solving: Supply the syntax and give the output.
Correct syntax of the function has been supplied 1pt
Correct output been supplied 2 pts
1. Enter 2 matrices
3. A-B 4. A*B
5. A^2
Answer I
1. Vector [1 2 3 4 5 6 7 8 9 10]; 6.im2bw()
2. column_vector = [1;2;3;4;5]; 7.gray2ind()
3. imread( ); 8. rgbImage(:,:,1); % Red channel
4. imwrite(); 9. rgbImage(:,:,2); % Green channel
5. bwboundaries 10. rgbImage(:,:,3); % Blue channel
Answer II
1. 6 7 2. 6 8 3. -4 -4 4. 19 22 5. 7 10
8 9 10 12 -4 -4 43 50 15 22
IIIAnswer