Homework 2
Download the problems here
Due date: 12th July before
You would need the following
files for your home work:
Description of the files:
trgIris.dat is an ascii file containing data for a classification problem.
The first four columns contains the 4 features and the remaining
3 columns are the class labels.
wr.txt is also an ascii file. It contains data for regression problem, the
first column is the x and the other one the y.
band1.irs, band2.irs,
band3.irs and band4.irs are binary files containing a satellite image of Kolkata captured in 4 different
frequencies. All these files have 512 *
512 bytes and one byte represents 1 pixel. The data in this file can be transferred
to a matrix of
integers using the following matlab commands:
fp = fopen('band1.irs','r');
a=fread(fp,[512,512],’int8’);
fclose(fp)
You can use the following commands to display the images:
imagesc(a); colormap gray;
lena_std.pgm contains a 256 *
256 pixel image in the pgm format. You can read and
display this image in matlab using the following
commands:
>> a = imread('lena_std.pgm','pgm'); % reads
the image in matrix a
>> imagesc(a); colormap gray; axis equal; %
displays the image in a