How to Match 2 Signals which Are a Shifted and Scaled Version of Each Other
Matlab has a function called xcorr() that computes the cross correlation between two vectors.  The cross correlation will be highest when the two signals overlap.  The following code will compute the shift in units of samples:

x = xcorr(s1,s2)
[val,idx] = max(x);
shift = length(s1) - idx

The scaling factor should be given by:

scale = max(s1)/max(s2)