MATLAB: How to get an average function

averagefunctionfunctionsmatlab function

i have a oscilating plot/figure and want to get the average function with its figure of that oscilating figure. how can i plot the average of the oscilating function?
for example: plot(a,b) is oscilating function and now i want to get an average function of this oscilating function