Question: Using this code in Matlab: clear all; close all; % clear workspace %% Dataset is created N=200; % number of data points x1=10*randn(N,1); % first

Using this code in Matlab:

clear all; close all; % clear workspace

%% Dataset is created

N=200; % number of data points

x1=10*randn(N,1); % first coordinates

x2=4+x1+10*randn(N,1); % second coordinates - example in space of dimension D=2

%% pca

X=[(x1-mean(x1))';(x2-mean(x2))'];

S=(X*X'/N);

[U,L,V] = svd(S);

%% plot data

figure;plot(x1,x2,'kx','LineWidth',2,'MarkerFaceColor','k'),...,

hold on, plot(mean(x1),mean(x2),'ro','LineWidth',2,'MarkerFaceColor','r'), hold on,...

quiver(mean(x1),mean(x2),V(1,1),V(2,1),sqrt(L(1,1)),'g','LineWidth',2), hold on, ...

quiver(mean(x1),@mean(x2),V(1,2),V(2,2),sqrt(L(2,2)),'b','LineWidth',2),hold off, axis equal

Graph:

Using this code in Matlab: clear all; close all; % clear workspace

Consider u1 and u2 eigenvectors of matrix S wih respective eigenvalues 1 and 2 with 1 > 2. Defining u3 = u1 + u2, is u3 an eigenvector of S? Explain.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!