Advertisement
Guest User

Untitled

a guest
May 21st, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.38 KB | None | 0 0
  1. K = A' * A;
  2. [row_num,~] = size(f_noisy);
  3. f = reshape(f, [row_num^2,1]);
  4. f_noisy_tmp = reshape(f_noisy, [row_num^2,1]);
  5. coeff = K \ (A' * f_noisy_tmp);
  6. new_f = A * coeff;
  7. scatter3(X(:),Y(:),new_f(:));
  8.  
  9. disp('error in relation to the original');
  10. error = sum((f - new_f).^2);
  11. disp(error);
  12. disp('error in relation to the noise');
  13. error = sum((f_noisy_tmp - new_f).^2);
  14. disp(error);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement