

Region OutageTime Loss Customers RestorationTime Cause To display the first five rows, use table indexing. The file outages.csv contains simulated data for electric power outages over a period of 12 years in the United States. I'm going to use readtable to read data from a sample file that ships with MATLAB. You can create a table using the table function, the Import Tool, or the readtable function. Today I will show several different ways to apply functions to groups in tables.įirst, let's create a table. And you can specify groups within table variables, to perform calculations on those groups. You can access table data by row, by variable, or by variable name. The variables in a table can have different data types, but must have the same number of rows. Tables are convenient containers for column-oriented data.

Multiple Variables as Input Arguments to Function.Perform Calculation on Groups in Numeric Variables.Perform Calculation on Each Numeric Variable.
