Advertisement
Ch4osCosmo

Untitled

May 24th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. function [linCoeffs] = getLinearTrend(y)
  2. %find linear trend by fitting polynomial of degree 1 to the values
  3. if isrow(y) == 1
  4. t=1:1:length(y);
  5. else
  6. t=(1:1:length(y))';
  7. end
  8. linCoeffs = polyfit(t,y,1);
  9. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement