From db18cfe84dd581bb064ba8aabd77b9477b39af87 Mon Sep 17 00:00:00 2001 From: Md Amit Hasan <110404396+amithasan-19311011@users.noreply.github.com> Date: Thu, 15 Jun 2023 21:02:56 +0600 Subject: [PATCH] Update ellipsoid_fit_data.m --- ellipsoid_fit_data.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ellipsoid_fit_data.m b/ellipsoid_fit_data.m index e25914c..035bf87 100644 --- a/ellipsoid_fit_data.m +++ b/ellipsoid_fit_data.m @@ -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