From b7090c735b9854d9c36f8e274cda1fe380f3d4a2 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 01:54:55 +0000 Subject: [PATCH] Fix test image projection formula in lab11.m Replaced the dual-line extraction and projection process with a single cohesive mathematical formula: `coef_test = U' * (img_test(:) - x_bar)`. This updates the code structure to correctly calculate the PCA projection coefficients while preserving the unmodified testing images and resolving the TODO comment. Co-authored-by: tsainez <13399044+tsainez@users.noreply.github.com> --- matlab/lab11.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/matlab/lab11.m b/matlab/lab11.m index 491f192..44e0700 100644 --- a/matlab/lab11.m +++ b/matlab/lab11.m @@ -64,8 +64,7 @@ img_test = face_testing(:, :, i); %% convert testing image to feature vector - img_test = img_test(:) - x_bar; - coef_test = U' * img_test; % TODO: replace this line + coef_test = U' * (img_test(:) - x_bar); error = zeros(n_train, 1); for j = 1:n_train