## 导入电子表格

### 以表的形式导入数据

```T = readtable("patients.xls"); T(1:5,1:5)```
```ans = 5×5 table LastName Gender Age Location Height ____________ __________ ___ _____________________________ ______ {'Smith' } {'Male' } 38 {'County General Hospital' } 71 {'Johnson' } {'Male' } 43 {'VA Hospital' } 69 {'Williams'} {'Female'} 38 {'St. Mary's Medical Center'} 64 {'Jones' } {'Female'} 40 {'VA Hospital' } 67 {'Brown' } {'Female'} 49 {'County General Hospital' } 64 ```

### 将数据以时间表形式导入

```TT = readtimetable("sample.xls"); TT(1:5,1:5)```
```ans = 5×5 timetable OutageTime Region Loss Customers RestorationTime Cause ________________ _____________ ______ __________ ________________ ___________________ 2002-02-01 12:18 {'SouthWest'} 458.98 1.8202e+06 2002-02-07 16:50 {'winter storm' } 2003-01-23 00:49 {'SouthEast'} 530.14 2.1204e+05 NaT {'winter storm' } 2003-02-07 21:15 {'SouthEast'} 289.4 1.4294e+05 2003-02-17 08:14 {'winter storm' } 2004-04-06 05:44 {'West' } 434.81 3.4037e+05 2004-04-06 06:10 {'equipment fault'} 2002-03-16 06:18 {'MidWest' } 186.44 2.1275e+05 2002-03-18 23:23 {'severe storm' } ```

### 以矩阵的形式导入数据

```M = readmatrix("basic_matrix.xls") ```
```M = 5×4 6 8 3 1 5 4 7 3 1 6 7 10 4 2 8 2 2 7 5 9```

### 将数据以元胞数组的形式导入

`C = readcell("basic_cell.xls")`
```C = 3×3 cell array {[ 1]} {[ 2]} {[ 3]} {'hello' } {'world'} {[ NaN]} {[10-Oct-2018 10:27:56]} {[ 1]} {1x1 missing}```