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 languages they are used.
Define data types in MATLAB
In MATLAB we do not require any type of declaration statement, when it gets any new variable name it creates the variable and allocates appropriate memory space to it but if the variable name already exists it will replace the original content with new content and allocate it to new storage space when required.
Syntax: variable name = a value (or an expression)
Example:
Matlab
% MATLAB code for variable initialization
Geeks = 7;
Output:

Data Types in MATLAB
In MATLAB data can be stored in different types, numeric, text, complex number, etc. To store these data MATLAB has different classes which have various characteristics. MATLAB provides a total of 16 fundamental data types.

Logic Type
Logic types are True and false values that are represented with the logical value 0 and 1. Any numerical value (non-complex) can be converted into a logical representation.
Syntax:G = logical (x)
Example:
Matlab
% MATLAB code for random matrix generation
rng default
A = randi(5,5) % It will generate random matrix of 15x5
B = A < 9 % The result is a logical matrix.
% Each value in B represents a logical 1 (true)
% or logical 0 (false) state to indicate whether
% the corresponding element of A fulfills the condition A < 9.
% For example, A(1,1) is 13, so B(1,1) is logical 0 (false).
% However, A(1,2) is 2, so B(1,2) is logical 1 (true).
Output:

Char and String type
In MATLAB character and string array provide storage for text type data. The strings are character array compared with the sequence of numbers called a numeric array.
Syntax: s = ‘String’
Example:
Matlab
% MATLAB code for showing String results
str = "Welcome to GeeksforGeeks, "
"Welcome!"" and lets start coding."
fprintf(str);
Output:

Numeric Type-
Integer and floating-point data are in this type with the following descriptions.
Data Type | Short Description | Features |
double | Double-precision arrays | - Default numeric data type (class) in MATLAB
- Stored as 64-bit (8-byte) floating-point value
- Range:
Negative numbers = -1.79769 x 10308 to -2.22507 x 10-308
Positive numbers = 2.22507 x 10-308 to 1.79769 x 10308
|
single | Single-precision arrays | - Stored as 4-byte (32-bit) floating-point value
- Range-
Negative numbers = -1.79769 x 10308 to -2.22507 x 10-308
Positive numbers = 2.22507 x 10-308 to 1.79769 x 10308
|
int8 | 8-bit signed integer arrays | - Stored as 1-byte (8-bit) signed integers
- Range is -27 to 27-1
|
int16 | 16-bit signed integer arrays | - Stored as 2-byte (16-bit) signed integers
- Range -215 to 215 -1
|
int32 | 32-bit signed integer arrays | - Stored as 4-byte (32-bit) signed integers
- Range is -231 to 231-1
|
int64 | 64-bit signed integer arrays | - Stored as 8-byte (64-bit) signed integers
- Range is -263 to 263-1
|
uint8 | 8-bit unsigned integer arrays | - Stored as 1-byte (8-bit) unsigned integers
- Range is 0 to 28-1
|
unit16 | 16-bit unsigned integer arrays | - Stored as 2-byte (16-bit) unsigned integers
- Range is 0 to 216 -1
|
uint32 | 32-bit unsigned integer arrays | - Stored as 4-byte (32-bit) unsigned integers
- Range is 0 to 232-1
|
uint64 | 64-bit unsigned integer arrays | - Stored as 8-byte (64-bit) unsigned integers
- Range is 0 to 264-1
|
Example:
Matlab
% MATLAB code for numeric type
str = 'Hello World';
int8(str)
Output:

Table
The table contains rows and column variables. Each variable can be of different data types and different sizes, but each variable needs to have the same number of rows. Range of functions are used to access data to create, edit, and read the table data.
Syntax:T = table(ColumnName1,ColumnName2);
Example:
Matlab
% MATLAB code for Table
T = table(Name,QuestionAttempted,CodingScore);
data = {'Atul Sisodiya',22,100};
Tnew = [Tnew;data];
Output:
Table array
2x3
Name QuestionAttempted CodingScore
Atul Sisodiya 22 100
Cell
A cell array is a MATLAB data type that contains indexed data containers called cells. Cells can contain any type of data, commonly contain character vectors of different lengths, numbers, an array of numbers of any size. Sets of cells are enclosed in () and access to the cells is done by using {} which is to create, edit or delete any cell functions.
Syntax: c = { }
Example:
Matlab
Output:

Structure
In structure data containers are used to group related data and their type, which are called fields. Fields may contain any type of data. In structures, Data is accessed using the dot notation.
Syntax: structname.fieldName
Example:
Matlab
geek(1).name = ("Atul Sisodiya");
geek(1).coding = 100;
geek
Output:

Function Handles
Function Handles is majorly used in MATLAB is to pass a function (numerical or char) to another function. Variables that are used to invoke function indirectly can be named as a Function handle.
To create a function handle ‘@’ operator is used.
Example: To create a function handle to evaluate x^2 + y^2, a function used is:
Output:
Similar Reads
MariaDB Data Types
MariaDB is an open-source software It has implemented various performance improvements over MySQL. It includes various enhancements such as the Aria storage engine, the Thread Pool feature, and the MaxScale proxy, all of which provide better performance and scalability. MariaDB has a large number of
5 min read
R Data Types
R Data types are used to specify the kind of data that can be stored in a variable. For effective memory consumption and computation, the right data type must be selected. Each R data type has its own set of regulations and restrictions.Variables are not needed to be declare with a data type in R, d
7 min read
Numpy data Types
NumPy is a powerful Python library that can manage different types of data. Here we will explore the Datatypes in NumPy and How we can check and create datatypes of the NumPy array. DataTypes in NumPyA data type in NumPy is used to specify the type of data stored in a variable. Here is the list of c
3 min read
PL/ SQL Data Types
PL/SQL (Procedural Language/Structured Query Language) is a procedural extension language for SQL used specifically for the Oracle database to ease the management of data and the flow of operations. A core feature of PL/SQL is its diverse set of data types, designed to handle everything from simple
6 min read
Data Type Conversion in MATLAB
Data Types in MATLAB is the upheld information organizes that are utilized for calculation. MATLAB is a well-known numerical and factual information investigation instrument that has a large number of elements for calculation. The different kinds of data type MATLAB supports are numeric types, chara
3 min read
Set Variable Data Types in MATLAB
There are many cases when a user has to import data into MATLAB script from various files. These file types could be .txt, .xlsx, .csv, .dat, etc. types. Now, each file type has its own method of defining data types. However, for computation purposes, MATLAB requires the data to be of numeric type,
3 min read
SAP ABAP | Data Types
Before Understanding the Data type first understand the Data object. Data objects are variables that we declare in the program. It occupies some memory where you can store the data from external sources. Data can be of different types, so data types are responsible for defining the type of data of t
6 min read
Types of Statistical Data
What is Statistical Data?Statistical data refers to the collection of quantitative information or facts that have been systematically gathered, organised, and analysed. These types of data can be collected from various methods, such as surveys, experiments, observations, or even from existing source
11 min read
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 b
2 min read
Numeric Types in MATLAB
Numeric class in MATLAB includes signed and unsigned integers, single-precision floating-point numbers, and double-precision floating-point numbers. Generally, MATLAB stores all numeric values as double-precision floating-point. But, we can choose to store any number, or, an array of numbers, as int
3 min read