Tables in MATLAB Last Updated : 28 Apr, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report 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. Creating Tables:Creating Empty or 0 by 0 Table:This can be done by a simple command. Example 1: Matlab % MATLAB Code for create table t = table(); This creates an empty table named t. 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: Accessing Table Elements:By Smooth Parenthesis ():This method returns requested columns and table variables. Syntax: Table (<number of rows>, <variable list>) Let us index the first two rows and the first and third variables of the above table. Example 3: Matlab % MATLAB Code name = {'Harry';'Mark';'Steven'}; age = [23; 54; 13]; Employed = logical([1;0;1]); emp = table(name,age,Employed); % Accessing the said rows and columns emp(1:2,[1,3]) Output : This extracted first 2 rows from first and third variable. By Dot Notation:The dot notation returns the passed variable as an array. Example 4: Matlab % MATLAB Code for dot notation name = {'Harry';'Mark';'Steven'}; age = [23; 54; 13]; Employed = logical([1;0;1]); emp = table(name,age,Employed); % Accessing age of second and third row emp.age(2:3) Output: By Curly Braces Notation {}:This method returns a concatenated array in the range of given rows and table variables. Example 5: Matlab % MATLAB Code for curly braces notation name = {'Harry';'Mark';'Steven'}; age = [23; 54; 13]; Employed = logical([1;0;1]); emp = table(name,age,Employed); % Accessing a sub table as an array emp{2:3,[2,3]} Output: Comment More infoAdvertise with us Next Article MATLAB - Data Types O owl0223 Follow Improve Article Tags : Software Engineering MATLAB-programs Similar Reads Timetables in MATLAB Timetables are a type of tables in MATLAB that store a timestamp corresponding to each row. Similar to tables, timetables can store column-oriented data under a variable name (column name), where every variable has same number of rows. All the functions of a table work with timetables as well along 2 min read Structures in MATLAB In MATLAB, structures are a way to group related data, where different data have different data types. These different data types are stored as fields inside a data container created by the struct command. A struct could have any number of fields ranging from 0 to indefinite. The structs could be 1- 3 min read Variable Names in MATLAB A variable is a named-memory location that stores different types of data which can be used to perform a specific set of operations. It can be thought of as a container that holds some value in memory. The Matlab workspace store all the variables being used during a session. This workspace not only 5 min read MATLAB - Data Types MATLAB is a platform which provides millions of Engineers and Scientists to analyze data using programming and numerical computing algorithm and also help in creating models. Data types are particular types of data items defined by the values they can store in them, generally, in programming languag 5 min read Simulink in MATLAB MATLAB which is also known as "Matrix Laboratory" allows its user to manipulate matrixes, plotting of functions and data, creation of algorithms, and user interfaces written in different programming languages by providing a computing environment. MATLAB is software designed and powered by mathworks. 4 min read MATLAB Syntax Writing code in the MATLAB environment is quite simple. We do not need to include any libraries/header files, we can directly start writing commands in the command window of the Editor. Usually, we write small and easily executable programs in the Command Window and larger programs with multiple lin 5 min read Like