F- Written QuestionsExam 2

# F Written - for loop that calculates 20(20 factorial You may not use the factorial function “No Computer” Question 2 Imagine that we had a new

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

14:440:127, Fall 2008 Exam 2 Version F 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for loop that calculates 20! (20 factorial). You may not use the factorial( ) function. “No Computer” Question 2: Imagine that we had a new data type called int7 , storing 7 bit (signed) integers. What’s the largest integer that int7 could store correctly? “No Computer” Question 3: Write a function called myrandom that generates three random numbers between 0.8 and 0.85, and returns (as its output) a vector containing those 3 numbers. Note that the function doesn’t take any input arguments. “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. as an example, for a different set of code, you might have: Yellow Black White Black Orange Pink Here is the code for you to use: 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

## This note was uploaded on 02/29/2012 for the course 440 127 taught by Professor Blase during the Fall '09 term at Rutgers.

Ask a homework question - tutors are online