Read a spreadsheet and calculate statistics of each variable in the spreadsheet
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a spreadsheet data with the header (variable name).
I would like to:
1. Read the spreadsheet using Import Wizard. 2. Assign variable name to each column. 3 Calculate summary statistics of each column.
Please advise how to proceed.
댓글 수: 2
채택된 답변
Tristan Yang
2018년 1월 2일
1. Read the spreadsheet using Import Wizard: Please use the 'Import Data' in the tool strip. Choose the spreadsheet you want to import, select the range, and import it as a 'table' type. This will create a variable with the spreadsheet file name that represents the table in MATLAB worksplace.
2. Assign variable name to each column: You can assess each column as an array with the variable names (header name). For example, if the table (named table1) has a column name 'age', then: >> table1.age would return all the ages of the rows.
3. Calculate summary statistics of each column: Please consider using the 'summary' function for 'table' type in MATLAB. Please refer to the following documentation page: https://www.mathworks.com/help/matlab/matlab_prog/calculations-on-tables.html
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!