a=[1 1 1 –1 -1];
b=[0 diff(a)];
c=[0 0 diff(a)];等待一个tick
YMatrix1 n行3列
plot1 = plot(YMatrix1,'Parent',subplot1);
set(plot1(1),'DisplayName','Close');
set(plot1(2),'DisplayName','Lead');
set(plot1(3),'DisplayName','Lag');
legend1 = legend(subplot1,'show');
set(legend1,'Location','Best');