MATLAB: How i can calculate percentage error between two data series time

digital signal processingMATLABMATLAB and Simulink Student Suitematlab functionsignal processingtime series

i have two data serie time . and i want calculate percentage error between c1 and c2 :
c1=[1;2;3;4;8;9;9;10;20]
c2=[1;2;2;4;8;7;9;10;20]

Best Answer

What is your reference for the percentage? c1 or c2?
pctError = mean(100 * abs(c2-c1) ./ c1); % c1 is the reference
pctError = mean(100 * abs(c2-c1) ./ c2); % c2 is the reference
Related Question