0% found this document useful (0 votes)
80 views2 pages

Pamantasan NG Cabuyao: College of Engineering

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 2

Prepared by: Engr Oliver A.

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.

Correct solution has been given 1 pt


Correct syntax of the function has been supplied 2 pts

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

3. Give a OCTAVE expression that multiplies


two vectors to obtain
5. A version of B with rows 2 and 3 swapped (reference is problem #2)

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

Try to solve for the result of the following:

EXPRESSION OUTPUT EXPRESSION OUTPUT


1. A + 5 2. A+B

3. A-B 4. A*B

5. A^2

CpE112 – Digital Signal Processing 1


Prepared by: Engr Oliver A. 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

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. j= 1 it prints the value of j with a format “j=” 2. b = [1:7; 9:-2:-3; 2.^(2:8)]


j= 2
j= 3
j= 4
j= 5
j= 6
j= 7
j= 8
j= 9
j = 10
3.d = (0:4)' * [1 1 1] 4. d = [1 1 1]' * (1:5)
5. display([1 0 0; 0 0 1; 0 1 0] * b);

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

CpE112 – Digital Signal Processing 2

You might also like