I have the ideal point (500,700) and the calculated point (499.79,700.44). I want to calculate the error but i can't. Please help me out

2 views (last 30 days)
clc
clear
Idealpoint=(500,700)
calculatedpoint=(499.79,700.44)
error=?
  4 Comments
Mehedi
Mehedi on 11 Jun 2014
your answer is perfect when i calculate error for a single value. but i want to calculate error for two value x and y. please, help me

Sign in to comment.

Answers (2)

José-Luis
José-Luis on 11 Jun 2014
absolute_error = mean(abs((observed(:) - simulated(:)) ./ observed(:)) .* 100)

Star Strider
Star Strider on 12 Jun 2014
How I would do it:
Idealpoint = [500,700];
calculatedpoint=[499.79,700.44];
pct_abs_err = 100 * abs((Idealpoint-calculatedpoint)./Idealpoint)
produces:
pct_abs_err =
42.0000e-003 62.8571e-003
  2 Comments
Star Strider
Star Strider on 12 Jun 2014
The usual practice is to calculate the error for each one.
If you want the combined error, I suppose taking the mean of both would work:
pct_abs_err = mean(100 * abs((Idealpoint-calculatedpoint)./Idealpoint))

Sign in to comment.

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by