Main Content

delsample

timeseries オブジェクトからサンプルを削除

説明

tsout = delsample(tsin,'Index',timeind) は、timeind の時間インデックスに対応する tsin のサンプルを削除します。

tsout = delsample(tsin,'Value',timevals) は、timevals の時間値に対応するサンプルを削除します。

すべて折りたたむ

timeseries オブジェクトのサンプルを削除します。

timeseries を作成し、時間サンプルとそれに対応するデータを表示します。

tsin = timeseries((0:10:50)',(0:5)');
tsin.Time
ans = 6×1

     0
     1
     2
     3
     4
     5

tsin.Data
ans = 6×1

     0
    10
    20
    30
    40
    50

最後のサンプルのインデックス (ここでは 6) を参照して、このサンプルを削除します。

tsout = delsample(tsin,'Index',6);
tsout.Time
ans = 5×1

     0
     1
     2
     3
     4

または、時間値 5 を指定して、tsin の最後のサンプルを削除することもできます。

tsout = delsample(tsin,'Value',5);

入力引数

すべて折りたたむ

入力 timeseries。スカラーとして指定します。

データ型: timeseries

時間インデックス。数値スカラーまたはベクトルとして指定します。

データ型: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

サンプル時間。数値スカラーまたは数値ベクトル、あるいは日付文字ベクトルの cell 配列として指定します。有効な日付文字ベクトルは、次の形式で表すことができます。

形式
dd-mmm-yyyy HH:MM:SS01-Mar-2000 15:45:17
dd-mmm-yyyy01-Mar-2000
mm/dd/yy03/01/00
mm/dd03/01
HH:MM:SS15:45:17
HH:MM:SS PM3:45:17 PM
HH:MM15:45
HH:MM PM3:45 PM
mmm.dd,yyyy HH:MM:SSMar.01,2000 15:45:17
mmm.dd,yyyyMar.01,2000
mm/dd/yyyy03/01/2000

データ型: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | cell

バージョン履歴

R2006a より前に導入