compare between two results with percentage Error

조회 수: 4 (최근 30일)
mohammed hussein
mohammed hussein 2017년 12월 6일
댓글: mohammed hussein 2017년 12월 6일
Hi
can you help me with this problem , i have two results (original and calculation) , i would like to compare the original with calculation results and have the percentage error in calculation part when compare with original . for example if i have
Original =[1;2;3;1;2;3]; calculation=[1;2;3;1;2;3];
the calculation is exact the original so the percentage Error in calculation is 0% if i have
Original =[1;2;3;1;2;3]; calculation=[1;1;3;2;2;1];
the calculation is not exact the original so the percentage Error in calculation has to be 50%
thank you

답변 (1개)

Alizée Perrin
Alizée Perrin 2017년 12월 6일
Your question is similar to this one.
Try this code :
PDif = 100*(calculation-original)./original;
  댓글 수: 1
mohammed hussein
mohammed hussein 2017년 12월 6일
thank you for your answer . i want to compare not by number but by similarity in numbers . if it is similar OK if it is not so it is wrong . the percentage is based on similarity in number .

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

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by