Hello MATLAB users,
I was wonder this.
Need help in finding an easy and explainable code to find the running mean to filter out the data on MATLAB.? Need help in finding an easy and explainable code to find and plotting the running mean to filter out the data on MATLAB.
For example you have
T=[22 24 16.2 8.4 -0.3 -7.3 -20.3 -37.1 -56.7];
h=[0 914 1876 3141 4267 5830 7530 9590 12280];
The plan is mathmatically to do for example
you have K = 2-9 for 3 pts
Tf(K) = (T(k-1)+T(k)+T(k+1))/3
Anyway there is a clear and explainable MATLAB code? Thanks!
Is this approach I should be taking?
do a mean filter (kind of like median filter, except mean) with a window size == 3.
Tmean=zeros(7);
for k=2:1:9,
Tmean(k)=(T(k-1)+T(k)+T(k+1))/3
end
k_axis=2:1:9
figure(1)
plot(k_axis, Tmean)
I got an error message stating:
Attempted to access T(10); index out of bounds because nume1(T)=9.
Error in Sample_Temperature_profile (line 12)
Tmean(k) = (T(k-1)+T(k)+T(k+1))/3;