MATLAB Answers

0

How do I use the command 'smooth' to smooth a plot of data I have pulled from two matrices?

Asked by Noah Wilson on 22 May 2018
Latest activity Edited by OCDER
on 22 May 2018
Here is the code I used:
if true
cloudy = find(Tday > 312.38 & Tday < 312.91);
T1smooth = smooth(Tmatrix(cloudy),'lowess');
figure(3),plot(Tday,T1smooth)
end

  0 Comments

Sign in to comment.

1 Answer

Answer by OCDER
on 22 May 2018
Edited by OCDER
on 22 May 2018

Assuming Tmatrix is a 1xN or Mx1 matrix, your use of smooth is correct. But note that you are doing smoothing ONLY on cloudy days, and not all days. The other way to do this is smooth Tmatrix, and then take the cloudy days. You'll probably get different results, but which is the correct order depends on the application.
plot(Tday(cloudy), T1smooth)

  0 Comments

Sign in to comment.