Monday, May 26, 2008

Assignment #4

On Octave/Matlab find the command to
1) make a matrix of 256 X 1
the octave command is Ones(256,1)
2) make a matrix of the integers 0 through 255 in a single row
Octave command [0:1:255]
3) make a column of the intergers 0 through 255
Octave command:[0:1:255]'
4) make a 256 X 256 matrix with the rows all the same equal to the numbers 0 to 255
Ones[256,1]*[0:1:255]
5) make a 256 X 256 matrix with the column, all the same, equal to the numbers 0 to 255
ones(256,1)*[0:1:255]'
6)make a 256 X 256 matrix of all zeros
zeros[256,256]
7)make a 256 x 256 matrix of all ones
ones[256,256]
8) make a 256 x 256 matrix of all values 128
128*ones(256)
9) make a 256 x 256 matrix of all zeros
same as 6)
10)display a greyscale image
Octave command: imshow(ones(256,1)*[0:1:255]/255)

No comments: