Code

Percent Error

September 30, 2011 Coded in Matlab

A lot of times, when I am running Matlab simulations I am comparing how close my results are to real measured data.  It is always a good idea to prove that your DSP simulation is matching what happens in real life before trusting its accuracy.  Below is a the equation for percent error, which  I admittedly had to run a google search on before I made this function.

function [per_error] = percent_error(measured, actual)
% Creates the percent error between measured value and actual value
%
% Usage: percent_error(MEASURED, ACTUAL);
%
%        Measured is the your result
%        Actual is the value that your result should be
%
% Author: sparafucile17

per_error = abs(( (measured - actual) ./ actual ) * 100);

Comments:

There are no comments yet!


Sorry, you need javascript enabled to post any comments.