lettura simple

The exponential function in Octave

In this lesson I'll explain how to use the exponential function on Octave.

What is the exponential function? The exponential function is the function $$ f(x)=e^x $$ The base of the power is the number e=2.7183, while x is the independent variable. The exponential function is defined for every real number. It is an increasing function and is equal to 1 for x=0.

In Octave there is a special function for writing the exponential function. It is the function exp(x)

exp(x)

I'll give you some practical examples

Type exp(1).

The result is Nepero's number because e1=2.7183.

>> exp(1)
ans = 2.7183

You can also get the same result by typing e^1

>> e^1
ans = 2.7183

Now, type exp(0)

The result is 1 because e0=1

>> exp(0)
ans = 1

You also get the same result by typing e^0

>> e^0
ans = 1

Now, type exp(-1)

The result is an even smaller number, because ex tends to zero as x→-∞

>> exp(-1)
ans = 0.36788

You can get the same result by typing the power e^(-1)

>> e^(-1)
ans = 0.36788




Report a mistake or post a question




FacebookTwitterLinkedinLinkedin