Filter löschen
Filter löschen

difference between anonymous function and symbolic function

22 Ansichten (letzte 30 Tage)
PJS KUMAR
PJS KUMAR am 5 Okt. 2018
Beantwortet: Adithi am 14 Jul. 2022
I declared a function in the following two ways. I want to know the difference between two function declarations
1) syms x y(x)
f=x+y
2) f=@(x,y) x+y
May I know the purpose of function handle

Antworten (1)

Adithi
Adithi am 14 Jul. 2022
Hello,
I understand that you are trying to figure out the difference between anonymous function and symbolic function.
Anonymous function:
An anonymous function is a one-line expression-based MATLAB function that does not require a program file. This is essential for problems that include solving a nonlinear equation, integrating, differentiating function, minimizing a function or a solving differential equation.
Refer to the below documentation for more information on anonymous function. https://in.mathworks.com/help/matlab/matlab_prog/anonymous-functions.html
Symbolic functions:
Symbolic functions represent math functions. The symbolic functions are used for differentiation, integration, solving ODEs. Refer to below documentation for more information on symbolic function.
Purpose of function handle.
A typical purpose of function handle is to pass a function to another function. In anonymous function the function handle is used because it can store not only an expression, but also variables that the expression requires for evaluation.
Hope this helps!.

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by