|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
本帖最后由 House 于 2020-4-16 18:19 编辑
1 N. _1 B+ i3 E3 q" v9 G: N4 y" x, G2 N- H6 V" }, n* V ~# D( T, _; R0 P
在使用Matlab 2016b的过程中发现以前没有用过的数据格式“table”,引用其帮助文件的一个示例,与各位分享其用法。
2 `" l: q' u( p- % Create a MATLAB table named patients from workspace variables.
- load patients;
- BloodPreasure = [Systolic Diastolic];
- patients = table(Gender,Age,Smoker,BloodPreasure);
- patients.Properties.RowNames = LastName;
- % Sort the table based on the Age variable.
- sorted = sortrows(patients,'Age');
- % Create a report with the sorted patients table
- rpt = mlreportgen.dom.Document('MyFileName','pdf');
- append(rpt,sorted);
- close(rpt);
- % Show the PDF report in the viewer
- rptview(rpt.OutputPath);6 W. \7 k6 A6 ?) J+ d9 I1 z2 `
: \0 |/ i2 @' N' ^! {* E9 @
" e+ H- v/ R5 F- K+ Q: c其中生成的patients即为table格式文件,调用数据方法为patients.BloodPreasure(1,: ),可以调出血压的第一行数据,以此类推。7 C4 `6 f& `# F+ U' l( D1 R
|
|