Engee documentation
Notebook

Function call

There are many functions available in Engee that perform various computational tasks.


There are functions that require input data. For example, the function to find the maximum value is maximum().

In [ ]:
A = [1 3 5];
maximum(A)
Out[0]:
5

When several parameters need to be passed to the function input, they are specified using commas.

In [ ]:
B = [2 4 6];
union(A,B) #Функия объединения двух векторов
Out[0]:
6-element Vector{Int64}:
 1
 3
 5
 2
 4
 6

The values returned by the function after execution can be written to a variable.

In [ ]:
Amin = minimum(B) #Функция нахождениия минимального значения вектора В
Out[0]:
2

If there are several output parameters, it is possible to specify the variables to which they will be written in brackets separated by commas. For example, as in the case of the function findmax(). As a result of execution, the function returns the value of the maximum element and its index.

In [ ]:
(Amax, idx) = findmax(A) #Функция нахождения индекса максимального элемента вектора и его значение
Out[0]:
(5, CartesianIndex(1, 3))

To output the text, it is necessary to specify it in quotes.

In [ ]:
display("Hello, world!")
"Hello, world!"

Conclusion

In this example we have looked at the main types of functions that exist in Engee. You can find more information on how to use functions in the documentation at: https://engee.com/helpcenter/stable/getting-started-engee/function.html.