RMS error of matrices

조회 수: 18 (최근 30일)
darksideofthemoon101
darksideofthemoon101 2011년 4월 6일
댓글: Todd Pierce 2022년 5월 11일
Hi,
I have 2 large matrixes (2048x2048), and have taken one away from the other to get a 'difference' matrix. I want to quantify this matrix by using an RMS error, however if I use a standard RMS error formula I get another 2048x2048 matrix.
Is there a way to get a single representative RMS value out?
Thanks,
Richard
  댓글 수: 1
Todd Pierce
Todd Pierce 2022년 5월 11일
Hi there,
I am in a simlar position to yourself however, i want to maintain the matrix with all the rms values in, what initial line did you type in to get the rms for every value in the matrix whilst maintaining the shape.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2011년 4월 6일
Isn't it usually
sqrt(mean(A(:).^2 - B(:).^2))

추가 답변 (1개)

darksideofthemoon101
darksideofthemoon101 2011년 4월 6일
I've been using
rms = sqrt((A - B)^2))
How dissimilar are these equations?
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 4월 6일
When A and B are arrays then A-B is an array, and (A-B)^2 is
(A-B)*(A-B) which is a matrix multiplication which will produce an output the same size as A (in this case.) sqrt() of that would then be the same size.
Nothing in your code calculates the _mean_ portion of "RMS". Root MEAN square.
Possibly I should have suggested
sqrt(mean((A(:)-B(:)).^2))
but I am too tired to look up the definition at the moment.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by