Function of function in Symbolic Math Toolbox

조회 수: 3 (최근 30일)
Radu Trimbitas
Radu Trimbitas 2020년 3월 25일
답변: Jayanti 2025년 2월 13일
How could I define a functional in Symbolic Math Toolbox , eg . I wish a generic definition that allows to choose several functions for f.

답변 (1개)

Jayanti
Jayanti 2025년 2월 13일
Hi,
You can define a functional using symbolic variables and functions by first creating a placeholder for any function of (x) using syms”. Then set up a generic integral functional that can accept any function as input. To evaluate it, assign a specific function and use the subs function:
You can refer to the following code for your reference:
syms f(x);
F = int(f, x, 0, 1);
%Give desired function definition
f(x)=x^2;
F1 = subs(F);
I am also attaching official MathWorks documentation link on “syms” and “subs” for your reference:
Hope this will be helpful!

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by