MATLAB: Can someone help me with enveloping the curve

dataenvelope

I need to get the result as attached. I have included the data required to plot the curve.

Best Answer

Have a look on envelope.
S = importdata('data.txt') ;
data = S.data ;
t = data(:,1) ; y = data(:,2) ;
plot(t,y) ;
hold on
[up,lo] = envelope(y);
plot(t,up,'r')
Your data is in text file data.txt