C- Written QuestionsExam 2

C- Written QuestionsExam 2 - Notice that each row is a...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
14:440:127, Fall 2008 Exam 2 Version C The entire exam is closed book, and there is no collaboration permitted. All of your answers must be written in blue books; you will have separate bluebooks for the “No Computer” and “Computer” sections. Be sure to put your name and RUID on all bluebooks you use. Each “Computer” question is worth twice as much as each “No Computer” questions. All answers must relate to the Matlab programming language. For the first 20 minutes, you will not be permitted to use the computer. After 20 minutes, we will collect your bluebook for the first 4 (written) questions, and you will be permitted no further changes to those answers. For the final 4 questions, you will be permitted to use the computer by logging in to your special “Exam Accounts.” If you log in to your normal engineering account at any point during the exam, you will automatically fail. “No Computer” Question 1: Write a loop to create the following matrix.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Notice that each row is a multiple of [4 8 12] 4 8 12 8 16 24 12 24 36 16 32 48 20 40 60 24 48 72 28 56 84 32 64 96 36 72 108 40 80 120 “No Computer” Question 2: Write 143 in binary. (In other words, convert from Base 10 to Base 2) “No Computer” Question 3: Write Matlab code that c reates a random 100x100 matrix full of integers between 5 and 100, and save it in the variable R . Now, convert R to a sparse matrix (and save it to the variable R2 ). Also , state which variable ( R or R2 ) will use less memory. “No Computer” Question 4: Given the following Matlab code, draw a grid that represents the image that’s displayed. For each pixel in the grid, write in what color it will be, i.e. for a different set of code, you could have: Yellow Black White Black Orange Pink A(:,:,1) = zeros(3); A(:,:,2) = ones(3); A(:,:,3) = zeros(3); A(1:3,1,2) = zeros(3,1) A(1,1,1) = 0.9; imagesc(A)...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online