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

clc
clear
Idealpoint=(500,700)
calculatedpoint=(499.79,700.44)
error=?

댓글 수: 4

What's the error function? Absolute error? Squared error? Separately for x and y?
What have you tried so far? If you would like to learn how to perform basic arithmetics in Matlab, please refer to the "Getting started" part of the documentation.
absolute_error = abs((observed - simulated) ./ observed) .* 100
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

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

답변 (2개)

absolute_error = mean(abs((observed(:) - simulated(:)) ./ observed(:)) .* 100)
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

In your result, we found two error. one error for x and one error for y. But i need a single error which contain above both error. Please, help me in this regard
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))

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

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

질문:

2014년 6월 11일

댓글:

2014년 6월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by