Creating Table Using Arrays

One can create tables from arrays of different data types but, same size.

Example 2:

Matlab




% MATLAB Code for table creation
name = {'Harry';'Mark';'Steven'};
age = [23; 54; 13];
Employed = logical([1;0;1]);
 
% Creating table with above data
emp = table(name,age,Employed)


Output:

 

Tables in MATLAB

Table is an array data type in MATLAB that stores column-based or tabular data of same or different types. A table stores each column-oriented data under a variable name (column name). These table columns can have different data types in each however, the number of data points in every column must be the same.

Similar Reads

Creating Tables:

Creating Empty or 0 by 0 Table:...

Creating Table Using Arrays:

...

Accessing Table Elements:

One can create tables from arrays of different data types but, same size....