填写时间序列图

时间:2013-04-01 02:35:53

标签: matlab time-series

我有这段代码,而我正在尝试做的是填写用时间序列制作的函数图。我尝试了完整的区域方法,但没有成功实现它们。我也尝试使用TP1out绘制而不是TP1,但这样做我失去了ZOH插值,图形变为线性。如果有人知道如何解决这个问题我会很感激。

TP1out = [1 0 0 1 0];
time = 0:4; 
TP1 = timeseries(TP1out,time,'name','task 1');
TP1.DataInfo.Interpolation = tsdata.interpolation('zoh');
plot(TP1), grid on
axis([0 4 0 1.5])

enter image description here

我知道这很愚蠢,但我尝试过很多东西,比如:

>> area(TP1)
Undefined function 'real' for input arguments of type
'timeseries'.

Error in xychk (line 48)
    x = real(y); y = imag(y);

Error in area (line 45)
            [msg,x,y] = xychk(args{1:nargs},'plot');

>> area(time,TP1)
Error using specgraph.areaseries/set
Array must be numeric or logical.

Error in specgraph.areaseries (line 40)
  set(h,args{:})

Error in area (line 83)
                    h = [h
                    specgraph.areaseries('YData',datachk(y(:,k)),
                    ...

>> area(time,TP1.Data)
Error using area (line 46)
Inputs must be 2-D.

0 个答案:

没有答案
相关问题