Programming Assignment: PCA

Note: This assignment is for each individual student to complete on his or her own.

In this assignment, you will implement PCA to compress images. To get started, you will need to download the starter code and unzip its contents to the directory where you wish to complete the assignment.


The problem considered in this assignment is to compress the image downloaded from

You are required the complete the following steps:

  1. Implement the PCA to reduce the dimension of the data.
  2. Construct the compressed image.

To get started, open the main script assignmentPCA.m. You are required to modify this script as well as all the other three scripts, including

  • m – Function to find the principle components
  • m – Function to transform data into the PC space
  • m – Function to transform data back to the original space








What to submit?

A zip file that includes the following items:

  • All codes (70 points)
  • A report that includes (30 points):
    1. (20 points) Compressed images when K = 5, 30, 100
    2. (5 points) Explain the impact of K
    3. (5 points) Describe how your current implementation can be potentially improved to achieve better performance.


Powered by WordPress