Skip to content

Update ellipsoid_fit_data.m #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ellipsoid_fit_data.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
D_pca_y = D_pca(:,2);
% scatter plot the data with asterisks '*'
plot(D_pca_x,D_pca_y,'*')
hold on
% Define ellipse_x and ellipse_y, x and y coordinates for the PCA ellipsoid in the first 2 dimensions as a function of theta
theta = 2*pi*[0:100]/100;

ellipse_x = 2*sqrt(eigvals(1))*cos(theta);
ellipse_y = 2*sqrt(eigvals(2))*sin(theta);
%Plot the ellipse with red dashed lines 'r--'

plot(ellipse_x,ellipse_y,'r--')
%Use axis equal to correct aspect ratio
axis equal