function retval = sinenvelope(func, step,len) % sinenvelope.m % Created by: Tasha Vanesian % Use this function to put an sine envelope on the first half of a function. sine_coefficient = [(sin((pi* [0:step:len/2.0]) / (len)) ) ... ones(1, length([len/2.0:step:len]) - 1) ]; retval = func .* sine_coefficient;