I've this h.m file to plot entropy and dH. To run it just type h enter or source ('h.m')
the file looks like:
clf;
xd=[1:1153]
h=[ data
]
plot (xd,h); hold on;
p=polyfit (xd,h,7);
x=linspace(min(xd),max(xd),101);
y=polyval(p,x);
plot(x,y, 'r', "linewidth", 3);
axis([0,1160, -2, 30])
hold on;
dp=polyderiv(p);
dy=polyval(dp,x);
plot(x,dy,'b',"linewidth", 3);
legend ('H with 128 window','Poly. Fitted 7 degree', 'Derivatives');
title ("Sarah's Forelink Entropy","fontsize",15);
xlabel ("Segment", "fontsize",14);
ylabel ("Entropy", "fontsize",14);
print -dsvg Hsa.svg;
clf;
axis([0,1160, -1, 1]);
plot(x,dy,'b',"linewidth", 3);
title ("Sarah's Derivatives of Forelink Entropy","fontsize",15);
xlabel ("Segment", "fontsize",14);
ylabel ("Change of Entropy", "fontsize",14);
legend ('Derivatives');
print -dsvg test.svg;
沒有留言:
張貼留言