How can i find the RMSE between 2D double matrices?

Can you please help me and tell me how to find the RMSE between two matrices. I have one matrice of satellite data with dimensions 2521x2889 double, and a matrice of model data with exact the same dimensions, 2521x2889 double. I also have the latitude and the longitude matrices. I want to find the RMSE between the satellite data and the model data by making a new, exact same dimensioned matrice with the RMSE values in order to plot it along with the longitude and the latitude. I have tried {RMSerror_f1_20150201=sqrt( sum(sum((model_data - sat_data).^2 ))/(2521*3889))} but it gives me a new NaN matrice. Thank you in advance!

 Respuesta aceptada

Greg Heath
Greg Heath el 13 de Jun. de 2017
E = T-Y;
SQE = E.^2
MSE = mean(SQE(:))
RMSE = sqrt(MSE)
Hope this helps.
Thank you for formally accepting my answer
Greg

2 comentarios

Thank you very much for the help!!!
KSSV
KSSV el 13 de Jun. de 2017
@ Panourgias Siderakos can you explain the difference between both the answers?

Iniciar sesión para comentar.

Más respuestas (1)

KSSV
KSSV el 13 de Jun. de 2017
Let A and B be your matrices.
iwant = sqrt(mean(A(:).^2 - B(:).^2)) ;

5 comentarios

It gives me a matrice with a 1x1 double dimensions. Also, in the workspace, this matrice has value of NaN.I don't know why but i am sure that's not the desired outcome.
KSSV
KSSV el 13 de Jun. de 2017
Yes.The values where land is (only in the satellite data) are NaN. All the others are values of sea surface temperature in degrees Celsius.
KSSV
KSSV el 13 de Jun. de 2017
Editada: KSSV el 13 de Jun. de 2017
Ohh...then obviously you will get NaN...you have to remove these NaN's then..
Let A be your satellite data which have NaN's. Follow like below:
A = A(~isnan(A)) ;
B = B(~isnan(A)) ;
iwant = sqrt(mean(A.^2 - B.^2)) ;
Oh God.Sorry for asking but i am still learning a lot here.How can i do that?

Iniciar sesión para comentar.

Categorías

Más información sobre CubeSat and Satellites en Centro de ayuda y File Exchange.

Preguntada:

el 13 de Jun. de 2017

Comentada:

el 13 de Jun. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by