How can I put this MSE equation into MATLAB?
Show older comments

3 Comments
Rik
on 28 Oct 2021
What did you try? A basic Matlab tutorial should be enough to teach you this. Did you do one?
Tanner Weilage
on 28 Oct 2021
Rik
on 28 Oct 2021
You can simply use division, sqrt, and .^ to get here.
Answers (1)
You could use immse(), or you can do it manually:
A = randi(100,10,1);
B = A + randn(10,1);
% use immse()
mse1 = immse(A,B)
% do the same thing
err = double(A)-double(B); % just in case the inputs are integer-class
mse2 = mean(err(:).^2)
EDIT:
I just noticed that's not what the paper is asking for. I have no idea what that expression is supposed to be, but it's not the MSE afaik. Either I'm stupid (it's not uncommon), or someone tried to write the expression for the RMS error and messed it up. Maybe there's some missing context that explains the discrepancy.
This is MSE:
This is RMSE:
I don't know what this is:
Anyone is free to explain what I'm missing.
1 Comment
Rik
on 29 Oct 2021
Good catch. My guess is that this was an attempt at the RMSE. I didn't even notice it wasn't before.
Categories
Find more on Particle & Nuclear Physics 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!