This preview shows pages 1–5. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CM0268 SOLUTIONS CARDIFF UNIVERSITY EXAMINATION PAPER Academic Year: 2008/2009 Examination Period: Mock Exam Paper Examination Paper Number: CM0268 SOLUTIONS Examination Paper Title: Data, Audio, Graphics and Image Signal Processing with MATLAB SOLUTIONS Duration: 2 hours Do not turn this page over until instructed to do so by the Senior Invigilator. Structure of Examination Paper: There are 15 pages. This examination paper is divided into 2 sections. There are 4 questions in total. There are no appendices. The mark obtainable for a question or part of a question is shown in brackets alongside the question. Students to be provided with: The following items of stationery are to be provided: ONE answer book. Instructions to Students: Answer 3 questions. Answer the question 1 from Section A and two out of three questions from Section B. Questions from each Section should be answered in the same answer book. The use of calculators without programmable memory is permitted. The use of translation dictionaries between English or Welsh and a foreign language bearing an appropriate departmental stamp is permitted in this examination. 1 PLEASE TURN OVER CM0268 SOLUTIONS Section A Question 1 is compulsory Q1. (a) What is the output from the following MATLAB statements: i. a=3; b=2; c = a +b [1] Output is: >> a=3; b=2; c = a +b c = 5 1 Mark Unseen Problem ii. i=1:2; i. * i [1] Output is: >>i=1:2; >>i. * i ans = 1 4 1 Mark Unseen Problem iii. a = 2 * ones(1,2) [2] Output is: >> a = 2 * ones(1,2) a = 2 2 NOTE IT CREATES A COLUMN VECTOR 2 Marks Unseen Problem 2 CM0268 SOLUTIONS iv. i=1:5; a = 2 * i(3:4) [2] Output is: >> i=1:5; >>a = 2 * i(3:4) a = 6 8 2 Marks Unseen Problem 6 Marks (sub part total) (b) The following MATLAB statements contain an error, state what the cause of the error is and correct the statement: i. a = [1 2 3]; b = [4 5]; c = a + b; [2] Error is: >> a = [1 2 3]; >>b = [4 5]; >>c = a + b; ??? Error using ==> plus Matrix dimensions must agree. Solution is to have a balanced number of array elements in a and b for example either use a = [1 2]; or b = [4 6]; depending on what computation was mean to achieve. 2 Marks Unseen Problem. One for cause and one for correction 3 PLEASE TURN OVER CM0268 SOLUTIONS ii. i = 1:10; i(2:4) = [4 3]; [4] Error is: >> i = 1:10; >>i(2:4) = [4 3]; ??? In an assignment A(I) = B, the number of elements in B and I must be the same. Correction is to do (for example) either i(2:3) = [4 3]; or i(2:4) = [4 3 2] depending on what the indexing was meant to be. 4 Marks Unseen Problem. 2 for cause and 2 for correction iii. a = [1 2 3]; b = [4 5 6]; a * b; [4] Error is: >> a = [1 2 3]; >>b = [4 5 6]; >>a * b; ??? Error using ==> mtimes Inner matrix dimensions must agree....
View
Full
Document
 Winter '11
 DavidMarshall

Click to edit the document details