| MATLAB® | ![]() |
ts1 = ctranspose(ts)
ts1 = ctranspose(ts) returns a new timeseries object ts1 with IsTimeFirst value set to the opposite of what it is for ts. For example, if ts has the first data dimension aligned with the time vector, ts1 has the last data dimension aligned with the time vector as a result of this operation.
The ctranspose function that is overloaded for timeseries objects does not transpose the data. Instead, this function changes whether the first or the last dimension of the data is aligned with the time vector.
Note To transpose the data, you must transpose the Data property of the timeseries object. For example, you can use the syntax ctranspose(ts.Data) or (ts.Data)'. Data must be a 2-D array. |
Consider a timeseries object with 10 samples with the property IsTimeFirst = True. When you transpose this object, the data size is changed from 10-by-1 to 1-by-1-by-10. Note that the first dimension of the Data property is shown explicitly.
The following table summarizes the size for Data property of the timeseries object (up to three dimensions) before and after transposing.
Data Size Before and After Transposing
Size of Original Data | Size of Transposed Data |
|---|---|
N-by-1 | 1-by-1-by-N |
N-by-M | M-by-1-by-N |
N-by-M-by-L | M-by-L-by-N |
Suppose that a timeseries object ts has ts.data size 10-by-3-by-2 and its time vector has a length of 10. The IsTimeFirst property of ts is set to true, which means that the first dimension of the data is aligned with the time vector. ctranspose(ts) modifies ts such that the last dimension of the data is now aligned with the time vector. This permutes the data such that the size of ts.Data becomes 3-by-2-by-10.
transpose (timeseries), tsprops
![]() | csvwrite | cumprod | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |