MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

2003-02-07 21:15 289.4 1.4294e+05
2004-04-06 05:44 434.81 3.4037e+05
2002-03-16 06:18 186.44 2.1275e+05


Subscript both on a time range and by variable type.


TR = timerange('2002-01-01','2003-12-31');
TT2 = TT(TR,S);
TT2(1:5,:)


ans=5×3 timetable
OutageTime Loss Customers




2002-02-01 12:18 458.98 1.8202e+06
2003-01-23 00:49 530.14 2.1204e+05
2003-02-07 21:15 289.4 1.4294e+05
2002-03-16 06:18 186.44 2.1275e+05
2003-06-18 02:49 0 0


Extract Data with Variables Property


Tables and timetables have a property, Variables, that you can use to extract data from
variables into a matrix, as long as the variables can be concatenated together.


Extract the numeric data from TT2 using the Variables property. A is a 1468-by-2
matrix of doubles. When you extract data from a timetable into an array, the row times
are not included.


A = TT2.Variables;
A(1:5,:)


ans = 5×2
106 ×


0.0005 1.8202
0.0005 0.2120
0.0003 0.1429
0.0002 0.2128
0 0


Select Timetable Data by Row Time and Variable Type
Free download pdf