How can i find the RMSE between 2D double matrices?
Show older comments
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!
Accepted Answer
More Answers (1)
KSSV
on 13 Jun 2017
Let A and B be your matrices.
iwant = sqrt(mean(A(:).^2 - B(:).^2)) ;
5 Comments
Panourgias Siderakos
on 13 Jun 2017
KSSV
on 13 Jun 2017
Any data in your matrix is NaN?
Panourgias Siderakos
on 13 Jun 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)) ;
Panourgias Siderakos
on 13 Jun 2017
Categories
Find more on CubeSat and Satellites in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!