How to do moving average for x and y data points in a scatter plot?
49 views (last 30 days)
Vidushi Koliyan on 23 Apr 2023
I have soil moisture (x) data in the first column and correlation(y) data in the second column. I want a moving average line through the scatter plot of x and y data.I am getting a line which is connecting all the points which seems quite wrong.
Can somebody help me with this?
Thank you so much.
Dyuman Joshi on 23 Apr 2023
Moved: Image Analyst on 23 Apr 2023
It's not clear to me what exactly do you want to achieve.
You say 10 points, but you use N=8.
"I want to see how moving average will look like with x y data. "
Do you mean like this?
x = DATA(:,1);
y = DATA(:,2);
N = 8;
%Moving mean of both x and y data