Find a single function in the form y=asin(b(x-h))+k that is approximately the same as y=sinx-cosx
y=sinx-cosx=√2*(√2/2*sinx-√2/2*cosx)=√2*sin(x-pi/4)
转化成这种形式就可以 。图形如下
用matlab 啊