title: Matlab: Mean Square Error
body: <p>Hi I am new to Matlab and I am having difficulties understanding the logic behind Mean Square Error. I have been given a signal and I am able to generate it and calculate SNR of the signal, is there a way to find mean square error between original signal and SNR signal?</p>
  
  <pre><code>% Number of Samples.
  n = 1:512;
  
  % Given Signal
  signal = exp(-5*(n-250).^2/100000).*cos(pi*(n-250)/6);
  
  % Range of SNR
  Snr = 30:-5:-10
  
  % Calculate and display MSE between the original signal and noisy signal
  </code></pre>
  
  <p>??????</p>