difference between anonymous function and symbolic function

44 ビュー (過去 30 日間)
PJS KUMAR
PJS KUMAR 2018 年 10 月 5 日
回答済み: Adithi 2022 年 7 月 14 日
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

回答 (1 件)

Adithi
Adithi 2022 年 7 月 14 日
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!.

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by