dataset2table
R2026bConvert dataset array to table
Syntax
Description
Examples
Load the hospital data set, which contains simulated information for 100 hospital patients.
load hospitalConvert the dataset array to a table.
t = dataset2table(hospital)
t = 100×7 table
LastName Sex Age Weight Smoker BloodPressure Trials
____________ ______ ___ ______ ______ _____________ _______________
YPL-320 {'SMITH' } Male 38 176 true 124 93 {[ 18]}
GLI-532 {'JOHNSON' } Male 43 163 false 109 77 {[ 11 13 22]}
PNI-258 {'WILLIAMS'} Female 38 131 false 125 83 {1×0 double }
MIJ-579 {'JONES' } Female 40 133 false 117 75 {[ 6 12]}
XLK-030 {'BROWN' } Female 49 119 false 122 80 {[ 14 23]}
TFP-518 {'DAVIS' } Female 46 142 false 121 70 {[ 19]}
LPD-746 {'MILLER' } Female 33 142 true 130 88 {[ 13]}
ATA-945 {'WILSON' } Male 40 180 false 115 82 {1×0 double }
VNL-702 {'MOORE' } Male 28 183 false 115 78 {[ 2]}
LQW-768 {'TAYLOR' } Female 31 132 false 118 86 {[ 11]}
QFY-472 {'ANDERSON'} Female 45 128 false 114 77 {[ 8 10 14]}
UJG-627 {'THOMAS' } Female 42 137 false 115 68 {[ 4 9]}
XUE-826 {'JACKSON' } Male 25 174 false 127 74 {1×0 double }
TRW-072 {'WHITE' } Male 39 202 true 130 95 {[ 8]}
ELG-976 {'HARRIS' } Female 36 129 false 114 79 {1×0 double }
KOQ-996 {'MARTIN' } Male 48 181 true 130 92 {[13 15 21 27]}
⋮
Input Arguments
Input dataset array to convert to a table, specified as a dataset array. Each variable in
ds becomes a variable in the output table
t.
Output Arguments
Output table, returned as a table. The table can store metadata such as descriptions, variable units, variable names, and row names. For more information, see Tables.
Version History
Introduced in R2013b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)