ds1 - ECE 178 Digital Image Processing Discussion Session...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 178 Digital Image Processing Discussion Session #1 Mehmet Emre Sargin msargin@ece.ucsb.edu January 12, 2007 Exercise: 1 Suppose A = 1 2 3 4 5 6 (1) In order to initialize A as stated above type >> A = [ 1 2 3;4 5 6 ] A = 1 2 3 4 5 6 The semicolon is used for suppressing the output. If you do not want to suppress the output, just ignore the semicolon at the end (Be careful when dealing with large arrays i.e. images). Warning! Remember, in Matlab you can not start a variable or a function or even a script name with a number. 1.m invalid question1.m valid 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
DS#1 ECE 594N Mehmet Emre Sargin msargin@ece.ucsb.edu Exercise: 2 First indices are for accessing rows and the second indices are for accessing columns. In order to access whole row or column, colon is used. >> A(2,3) ans = 6 >> A(:,1) ans = 1 4 >> A(1,:) ans = 1 2 3 You can access the elements of an array also by specifying a single index A ( i,j ) A ( i + r ( j - 1)). Where
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/12/2009 for the course ECE 178 taught by Professor Manjunath during the Winter '08 term at UCSB.

Page1 / 5

ds1 - ECE 178 Digital Image Processing Discussion Session...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online