Calculate percentage difference between two variables

I want to calculate percentage difference between measured and calculated variables along the time axis. Both measured and preducted variables are arrays of different size. I want to calculate the percentage error for the corresponding time.

댓글 수: 3

Torsten
Torsten 2019년 8월 6일
편집: Torsten 2019년 8월 6일
percentage_error = abs(1-predicted/measured) * 100 ?
Or
100 * ( predicted - measured ) / measured
?
Muzammil Ali
Muzammil Ali 2019년 8월 6일
편집: Muzammil Ali 2019년 8월 6일
Thank you for your answer. Yes, this is what I want but it will not work as size of the array predicted is different from size of array measured. And hence predicted(xx) is not at the same time as measured(xx).

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

 채택된 답변

Luna
Luna 2019년 8월 6일
편집: Luna 2019년 8월 6일

0 개 추천

You should resample one array's elements according to other array's time.
Check the below function for this:
After resampling your 2 arrays will be the same size. You can substract.

추가 답변 (0개)

카테고리

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

질문:

2019년 8월 6일

편집:

2019년 8월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by