MATLAB Answers

0

Mean square error of two matrices

Asked by Anurag Pujari on 1 Apr 2013

How to calculate the mean square error of two matrices? How to use the inbuilt MATLAB function msc for that?The Mathworks help for mse is not clear to me.

  0 Comments

Sign in to comment.

Tags

1 Answer

Answer by Wayne King
on 1 Apr 2013
 Accepted Answer

Do you have the Wavelet Toolbox? If so, you can use measerr(), otherwise, suppose your original matrix is X and your approximation is Xapp

   X = randn(256,256);
   Xapp = randn(256,256);
   D = abs(X-Xapp).^2;
   MSE = sum(D(:))/numel(X);

  6 Comments

As I am comparing two matrices of voice signals, so will it create problem if I use the above randn function as it returns any random numbers!

Yes, of course. You have to realize that since I don't have your data I just have to make up an example to show you how to do it.

Thanks for helping me out sir.

Sign in to comment.


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today