Calculate the mean square error in a localization process

1 回表示 (過去 30 日間)
Nicola Caldognetto
Nicola Caldognetto 2020 年 4 月 24 日
回答済み: Ameer Hamza 2020 年 4 月 24 日
I'm estimating the position of an agent. I know the x,y coordinates of both the estimated position and the real position.
I would like to compute the MSE with a function like this one https://www.mathworks.com/help/images/ref/immse.html
Is there a way?

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 24 日
If you have deep learning toolbox, then you can use the mse() function: https://www.mathworks.com/help/releases/R2020a/deeplearning/ref/dlarray.mse.html
estimated = [x_estimated y_estimated]; % x_predicted and y_predicted are column vectors
real = [x_real y_real]; % x and y are column vectors
mse_value = mse(estimated, real)
If you don't have the toolbox, then you can write your own function
function mse_value = mse(estimated, real)
mse_value = mean((estimated-real).^2, 'all');
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeModel Predictive Control Toolbox についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by