## Mean square error of two matrices

on 1 Apr 2013

### Wayne King (view profile)

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.

### Wayne King (view profile)

on 1 Apr 2013

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);```

Anurag Pujari

### Anurag Pujari (view profile)

on 1 Apr 2013

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!

Wayne King

### Wayne King (view profile)

on 1 Apr 2013

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.

Anurag Pujari

### Anurag Pujari (view profile)

on 1 Apr 2013

Thanks for helping me out sir.