Skip to content
Permalink
72c658286e
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
12 lines (11 sloc) 264 Bytes
function re = Rel_error (T)
% Rel_error: calculates relative error of a vector
% re = Rel_error (T)
% input:
% T = vector of numbers
% output:
% re = relative error of vector
re = zeros(1,length(T)-1);
for i = 2:length(T)
re(i-1)= abs(T(i)-T(i-1))/T(i-1);
end