Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [linCoeffs] = getLinearTrend(y)
- %find linear trend by fitting polynomial of degree 1 to the values
- if isrow(y) == 1
- t=1:1:length(y);
- else
- t=(1:1:length(y))';
- end
- linCoeffs = polyfit(t,y,1);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement