Effacer les filtres
Effacer les filtres

difference between anonymous function and symbolic function

19 vues (au cours des 30 derniers jours)
PJS KUMAR
PJS KUMAR le 5 Oct 2018
Réponse apportée : Adithi le 14 Juil 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

Réponses (1)

Adithi
Adithi le 14 Juil 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!.

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by