Read a spreadsheet and calculate statistics of each variable in the spreadsheet
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
alpedhuez
am 27 Dez. 2017
Kommentiert: alpedhuez
am 2 Jan. 2018
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 Kommentare
Akzeptierte Antwort
Tristan Yang
am 2 Jan. 2018
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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!