Sign in

username or email:

password:



Not a member?
Forgot your password?

Search code



Search tips


See Also

Embedded SystemsFPGA

DSP Code Sharing > Percent Error

Percent Error

Language: Matlab

Processor: Not Relevant

Submitted by on Sep 30 2011

Licensed under a Creative Commons Attribution 3.0 Unported License

Percent Error


 

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);
 
 
Rate this code snippet:
0
Rating: 0 | Votes: 0
 
   
 
posted by



Comments


No comments yet for this code


Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )