plot_imf是个子程序,代码如下:
function plot_imf(x,t,imf)
s = size(imf);
k = s(1);
figure;
for j = 1:k-1
subplot(k,1,j)
plot(t,imf(j,:))
ylabel(['imf',int2str(j)])
end
subplot(k,1,1)
title('Empirical Mode Decomposition')
subplot(k,1,k)
plot(t,imf(k,:),'r')
ylabel('res.')
xlabel('t/s')
end
将此程序保存为一个子程序即可。