Exercise 1 this le contains two arrays a and b each of

Assignment Help Applications of MATLAB
Reference no: EM13350419

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: EM13350419

Questions Cloud

Question1a 67 human sprinters can accelerate from rest to : question1a 67 human sprinters can accelerate from rest to 11 in 3.0. throughout the similar interval a 32 greyhound can
Question1a simple pendulum consists of an object suspended : question1a simple pendulum consists of an object suspended by a string. the object is supposed to be a particle. the
Objectivethe key objective of this assignment is to : objectivethe key objective of this assignment is to critically assess the rationale and outcomes of a specific
Question1a 350 piano slides 34 down a 34 incline and is : question1a 350 piano slides 3.4 down a 34 incline and is kept from accelerating by a man who is pushing back on it
Exercise 1 this le contains two arrays a and b each of : exercise 1 this le contains two arrays a and b. each of these arrays contains a number of 50 50 grayscale images of
Question1consider a radius10cm circular nondiverging pencil : question1consider a radius1.0cm circular nondiverging pencil beam of 3x108 photons one-third with an energy of 1 mev
Question identify some of the barriers to supply chain : question identify some of the barriers to supply chain integration that exist in your business or a well-known
Choose examples from your own experience or find : choose examples from your own experience or find appropriate cases on the web that you can discuss. credit will be
Questionneed some assistance with a group international : questionneed some assistance with a group international business assignmenttopic-a new buzz word brics is being

Reviews

Write a Review

Applications of MATLAB Questions & Answers

  Problem consider a trapezoidal piece of polymer film as

problem consider a trapezoidal piece of polymer film as shown below. the parallel sides of the trapezoid are insulated

  In a shell-and-tube heat exchanger one fluid passes through

in a shell-and-tube heat exchanger one fluid passes through a central tube while another fluid flows through an outer

  1 we want to find the integral of a function at an

1. we want to find the integral of a function at an arbitrary location x from the origin.nbsp thuswhere ix0 is the

  Write a matlab function speed planetary n emesh first last

write a matlab function speed planetary n emesh first last arm that computes the speed of a given link in a

  1 this problem is intended to demonstrate some problems

1. this problem is intended to demonstrate some problems that can arise from the finite precision of numerical

  Create the following graph which contains a piecewise

create the following graph which contains a piecewise function where a line exists in the first interval a parabola in

  1 given the following actual cpu burst for a tasknbsp 6 4 6

1. given the following actual cpu burst for a tasknbsp 6 4 6 4 13 13 13 and an initial best guess at the burst as 10

  Problem 1nbsp use matlab to answer the following system of

problem 1.nbsp use matlab to answer the following system of linear equations2x y 3z 1 2x 6y 8z 3 6x 8y 18z 5

  Implementation in matlab under windows to open a named pipe

implementation in matlab under windows to open a named pipe and to read data from the pipe an other program writes into

  P1 write the commands that will create the following matrix

p1 write the commands that will create the following matrix. you can use only special matrix commandsp2 two cars

  1 let pnx be the lagrange interpolating polynomial of

1. let pnx be the lagrange interpolating polynomial of degree at most n that satis?es pnxi yi i 0 1 2 . . . n.write

  Q1 filter function form is y myfilterxba where x is

q1 filter function form is y myfilterxba where x is input y is output and a and b are the iir and fir

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