MATLAB is a helpful tool for scientists and engineers to solve complicated mathematical problems using a single function. It includes many built-in functions that make it easy for you to quickly solve any mathematical problems. One of the well-known mathematical problems that you will mostly experience is finding the exponentials of a value. To solve this problem, MATLAB introduced an exp() function.
If you are not sure about the working of the exp() function in MATLAB, read this guide. You will find a detailed guide on how to use this function using some examples for better understanding.
How to Find Exponentials in MATLAB Using the exp() Function?
In MATLAB, finding the exponential value of a number is made possible with the built-in exp() function. It enables you to effortlessly calculate the exponential value of a number or an entire array of values. This function accepts a value or an array of values as an input and returns the calculated exponential of a value. Whether you need to calculate the exponential growth of data or solve any exponential equation, the exp() function will be there for you to quickly solve your problem.
Syntax
The exp() function uses a simple syntax in MATLAB that is given below:
Here:
The function Y = exp(X) computes the exponential value of the given input X.
- If X is a scalar value, Y will be a scalar value that is equal to eX where e is the Euler’s constant.
- If X is an array, Y will be an array containing the exponentials of each element of the array X.
- If X is a complex number like X = x +iy, Y will be a complex number calculated by the given formula:
Example 1: How to Find the Exponential of Scalar Value, Vector, and Matrix Using the exp() Function?
The given example computes and displays the exponentials of the given scalar value, vector, and matrix using MATLAB’s exp() function.
y_1 = exp(x)
V = [-9 7 0.675 7];
y_2 = exp(V)
A = magic(2);
y_3 = exp(A)
Example 2: How to Find the Exponential of a Complex Number Using exp() Function?
This example computes the exponential of the given complex number X using MATLAB’s exp() function.
Y = exp(X)
Conclusion
Finding exponential values of a number, vector, or matrix is the most common problem in mathematics and engineering. These values can be calculated in MATLAB using the built-in exp() function. This function computes the exponentials of the given value or values using the mathematical eX formula where e is the Euler’s constant. This guide has explained the working of the exp() function with some easy examples to help you calculate the exponentials of the given value or values.