Question: I need help with my MATLAB code. Here is my code. A = [ 1 2 3 ; 4 5 6 ; 7 8 9

I need help with my MATLAB code. Here is my code. A =[123; 456; 789];
[U, S, V]= svd (A);
A1= U(:,1)* S(1,1)* V(:,1)';
RMSE_A1= sqrt(mean((A(:)- A1(:)).^2)); d1= dot(U(:,1), U(:,2));
cross_product = cross(U(:,1), U(:,2)); span_U = rank(U)== min(size(U)); load ('MAT 350 Project Two MATLAB Image.mat');
imshow(A);
[m, n]= size (A) k_CR2= floor(original_size /2);
image_approx_CR2= U(:,1:k_CR2)* S(1:k_CR2,1:k_CR2)* V(:,1:k_CR2)'; This is the part im having trouble with. my code here says "unrecognized function or variable image". not sure what to do here. RMSE_img = sqrt(mean((image(:)- image_approx_CR2(:)).^2)); imshow(image_approx_CR2); % For CR 10
k_CR10= floor(original_size /10);
image_approx_CR10= U(:,1:k_CR10)* S(1:k_CR10,1:k_CR10)* V(:,1:k_CR10)';
RMSE_CR10= sqrt(mean((image(:)- image_approx_CR10(:)).^2));
% For CR 25
k_CR25= floor(original_size /25);
image_approx_CR25= U(:,1:k_CR25)* S(1:k_CR25,1:k_CR25)* V(:,1:k_CR25)';
RMSE_CR25= sqrt(mean((image(:)- image_approx_CR25(:)).^2));
% For CR 75
k_CR75= floor(original_size /75);
image_approx_CR75= U(:,1:k_CR75)* S(1:k_CR75,1:k_CR75)* V(:,1:k_CR75)';
RMSE_CR75= sqrt(mean((image(:)- image_approx_CR75(:)).^2));
% Analyze the trends observed in image approximation as the compression ratio increases
% Based on the RMSE values obtained for different compression ratios, make recommendations for the best compression ratio
% Displaying the approximate images for CR 10,25, and 75
imshow(image_approx_CR10);
imshow(image_approx_CR25);
imshow(image_approx_CR75);

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 Accounting Questions!