Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: root mean square error calculation matlab code
Replies: 3   Last Post: Feb 23, 2014 1:17 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Curious

Posts: 1,986
Registered: 12/6/04
Re: root mean square error calculation matlab code
Posted: Feb 21, 2014 10:10 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Ong Teng" <ongwenteng0227@gmail.com> wrote in message <le6kh0$6am$1@newscl01ah.mathworks.com>...
> Hi Greetings,
>
> Can I know whats wrong with my code below? Anyone can help? EvalHeartSet is my data set that loaded into matlab to evaluate the data.
>
> ev=EvalHeartSet(:,end);
> rmse(1)=norm(evu(1,:)-ev)/sqrt(length(evu(1,:)));
> rmse(2)=norm(evu(2,:)-ev)/sqrt(length(evu(2,:)));
>
> subplot(2,1,1);
> if rmse(1)<rmse(2)
> r=1;
> else
> r=2;
> end
>
> str=sprintf('Testing Set RMSE: %f',rmse(r));
> disp(str);
> ctr=0;
> for i=1:m
> if evu(r,i)==ev(i)
> ctr=ctr+1;
> end
> end
>
> Thanks.


What makes you think anything is wrong with it?
What error messages are you getting?
Wrong answers?

Without knowing the values of ev & evu, there is not much we can do to help.

One possibility: it is bad practice to compare real numbers for equality as in:

if evu(r,i)==ev(i)

You should consider something like:

if abs(evu(r,i) - ev(i)) < tol

instead. Where tol is a "small" number.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.