The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

Posts: 2,359
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" <> wrote in message <le6kh0$6am$>...
> 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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.