Borrar filtros
Borrar filtros

difference between anonymous function and symbolic function

22 visualizaciones (últimos 30 días)
PJS KUMAR
PJS KUMAR el 5 de Oct. de 2018
Respondida: Adithi el 14 de Jul. de 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

Respuestas (1)

Adithi
Adithi el 14 de Jul. de 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!.

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by