How can i implement least squares of the difference between 2 matrices?

Hi,
I'm trying to get the least squares of the difference between 2 matrices
argmin |g-u| both g and u are matrices of size [280,307,191]
any help?

Antworten (1)

Hi
Error= g-u;
MSE=mean(Error(:).^2)

6 Kommentare

what about the term arg min " |g-u| "
"||g-u||" is the least squares
Thank you
I'm not sure:
Error= g-u;
SquersError=Error.^2;
LeastSquersError=min(SquersError(:));
Argmin=Error(SquersError==LeastSquersError);
Explain in words what "argmin" means to you. Then we can try to answer.
what i understand is that it's the argument of the minimum,i want to optimize this equation :
||g-u|| where g and u are both images of same size .
For these u and g what is the answer?
u=[211 103 93; 256 239 16; 96 110 216];
g=[147 38 131; 11 228 112; 158 192 41];
Error= g-u;
SquersError=Error.^2;
LeastSquersError=min(SquersError(:));
Argmin=abs(Error(SquersError==LeastSquersError))
Is 11 the result you want?
i really have no idea what the constrained least squares means! but all i understood is that the term
|| g-u || is the data fidelity term between these 2 images(matrices) and the whole equation
x = ||g-u ||.^2 is the constrained least squares
and i'm trying to know what the result should be

Melden Sie sich an, um zu kommentieren.

Gefragt:

am 10 Apr. 2013

Community Treasure Hunt

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

Start Hunting!

Translated by