This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Class: timeseries

Size of data sample in timeseries object




getdatasamplesize(ts) returns the size of each data sample in a timeseries object.

Input Arguments


String specifying the name of a timeseries object.


data sample

One or more scalar values recorded at a specific time. The number of data samples is the same as the length of the time vector.


After loading data and creating a timeseries object, get the size of a data sample:

% Load a 24-by-3 data array:
load count.dat

% Create a timeseries object with 24 time values:
count_ts = timeseries(count,[1:24],'Name','VehicleCount')

% Get the size of the data sample for this timeseries object:

MATLAB® returns the following, which indicates that the size of each data sample in count_ts is 1-by-3. In other words, MATLAB stores each data sample as a row with three values.

ans =

     1     3

See Also


Introduced before R2006a

Was this topic helpful?