No BSD License  

Highlights from
Generic Signal Class

from Generic Signal Class by Stefan Bleeck
A generic class that allows easy signal (data in time) managment

[m,b]=linearfit(sig)
function [m,b]=linearfit(sig)
% fit the signal with a streight line and return the slope (m) and the zero
% crossing (b)

y=getvalues(sig);
x=getxvalues(sig);
[p,s] = polyfit(x,y,1);

m=p(1);
b=p(2);

Contact us at files@mathworks.com