Compute the economy sized svd

Assignment Help MATLAB Programming
Reference no: EM134374

Exercise 1 This le contains two arrays, A and B. Each of these arrays contains a number of 50  50 grayscale images of faces. The array A contains a library of 20 faces and has size 50  50  20, and the array B contains 4 test faces and has a size 50504. In this exercise, you should be plotting and reshaping these images often to make sure that everything makes sense! You can plot an image in A using the following command:

>> imagesc(A(:,:,1)), colormap gray;
Another nice way to plot is:
>> pcolor((A(:,:,16))), shading interp, colormap(gray), set(gca,'Xtick',[],'Ytick',[])
>> axis ij

(a) Reshape the A array so that it is size 202500 and each row is one of the images. (Be careful if you use the reshape command, since you will want to reshape into a 2500  20 array and then take the transpose!).

(b) Compute the economy sized SVD of the reshaped A matrix.

returned by svd has the singular values on the diagonal.

(c) Images 1   5 of A are all of Clooney, images 6   10 are of Obama, images 11   15 are of Thatcher, and images 16   20 are of Damon. Compute the average face for each of Clooney, Obama, Thatcher, and Damon. Project these onto the eigenface directions obtained above. Recall that since we reshaped images into row vectors, projecting onto eigenface directions is the same as multiplying with the V matrix from the SVD.

(d) Reshape the B array of test images so that it is size 4  2500 (use the same method that you used for array A). Project each of these four test images onto the eigenface directions to obtain four vectors, each of length 20. For each of the test images, compute the distance in eigenface space to the average Clooney, Obama, Thatcher, and Damon faces. Given two vectors f1 and f2 in eigenface space, you may compute the distance using something like: >>
distance = norm(f1-f2);.

Exercise 2 This data contains the velocity (meters/second) as a function of time (seconds). Find the acceleration as a function of time. To do this, you will need to di erentiate the data as a function of time. Do this in the following ways (it is interesting to plot the following approximate derivatives on the same plot to see the various features!):
(a) Use an O(t2) accurate scheme on the raw data. Please use a central di erence on the interior points, and an O(t 2) forward/backward di erence scheme on the end points.

(b) Fit a spline through the data with t=0:0.01:30; and nd the O(t2) and O(t4) derivative (in both cases, use a O(t2) forward/backward di erence scheme at the end points).

(a) Integrate using a trapezoidal rule. Use the cumtrapz command to compute the cumulative integral at each intermediate time.

(b) Use a spline with t=0:0.01:30 and a trapezoidal rule to evaluate the integral. Again, use the cumtrapz command.

(c) Create a function that returns the spline interpolation using function handles. Integrate this function with the quad command from t = 0 to t = 30.

Reference no: EM134374

Questions Cloud

How to compute average power output : How to compute  Average power output
Find the total work done on the car : Find the total work done on the car
Identify the funding mechanism of the project : Identify the funding mechanism of the project, and the sources of funding. Identify the key players or stakeholders of the project. Who is supposed to benefit from the initiative?
The valuable coefficient of kinetic friction : The valuable coefficient of kinetic friction
Compute the economy sized svd : Compute the economy sized SVD of the reshaped A matrix.
Find out ratio of the detector : Find out  ratio of the detector
Barriers to supply chain integration : Identify some of the barriers to supply chain integration
What practical steps could be taken to increase visibility : What practical steps could be taken to increase 'visibility' in the supply chain of A chosen business? What would the potential benefits be and would they outweigh the risks involved?
Need some assistance with a group international business : Need some assistance with a group international business assignment QUESTION- Any references you would make for creating greater international business achievement between Russia and the United States?

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd