MATLAB: Percentage of variation

percentage

Hi all, could anyone please help me to write this equation to calculate the percentage of variation. every time I got different results when running the code (i.e. greater than 100%)
b = [abs[Yav - Ycp] / Yav] * 100
thank you in advance.

Best Answer

b = 100*abs(Yav - Ycp)./ Yav