In this tutorial, we will learn about Octave’s built-in functions.
Octave provides the basic mathematical functions inbuilt. We can just invoke them with the arguments to use them in the scripts.
Octave Built-in functions
Octave has a large library of built-in mathematical functions. Some of the Octave built-in functions are as follows:
|exp(x)||To compute the exponential function e^x.|
|log(x)||To compute the natural logarithm function ln(x).|
|log10(x)||To compute the logarithm of the base 10.|
|abs(x)||The function returns the absolute value of the argument. |
|sqrt(x)||To compute the square root of x.|
|factorial(x)||To compute the factorial of x.|
To learn more about each function, type the doc function_name in the command window prompt. For example, to know the documentation of the function exp
>> doc exp
Let’s invoke these functions with some examples.
We can invoke the function by typing the name of the function in the command window. We can pass the function argument (or arguments) within the brackets( )
ans = 2.7183
ans = 7
ans = 1.0986
ans = 8
Octave Tutorial on this website can be found at:
More information on Octave can be found on the official website: