Calculating mean square difference (MSD) of two matrices
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jimmy Neutron
el 25 de Nov. de 2021
I would like to calculate the MSD of two matrices, but I cannot figure what MSD actually is. From my understanding, it is like this:
Im = [0 252 204;
221 135 58;
156 122 127]
Im2 = [169 250 237;
186 196 148;
227 148 4]
F2 = sum(sum(mean(Im2-Im).^2))
0 comentarios
Respuesta aceptada
Chunru
el 25 de Nov. de 2021
Im = [0 252 204;
221 135 58;
156 122 127]
Im2 = [169 250 237;
186 196 148;
227 148 4]
F2 = sum(sum(mean(Im2-Im).^2))
% Mean Squared Difference
% mean diff squared all elements
F = mean((Im - Im2).^2, 'all')
3 comentarios
Chunru
el 26 de Nov. de 2021
'all' means to sum all elements of the array. sum(sum(mean(Im2-Im).^2)) is to compute the difference (Im2-Im), then find its mean, then square, then sum up all elements.
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!