Multivariate symbolic math function from input sym vector

버전 1.0.1 (2.82 KB) 작성자: Imran Khan
Outputs multidimensional and multivariate symbolic function from input symbolic vector
다운로드 수: 1
업데이트 날짜: 2024/6/12

라이선스 보기

Currently, MATLAB's symbolic toolbox does not allow functions to be defined in the following way:
N = 3;
syms my_var [N 1];
syms my_func(my_var);
At present, doing this deletes the my_var variable and overwrites it as a scalar. The only way to define multivariate functions is explicitly, which requires knowing the input vector dimensionality beforehand:
syms my_func(my_var1,my_var2,my_var3);
my_var = [my_var1;my_var2;my_var3];
This function allows my_func to be defined through its input vector my_var:
N = 3;
syms my_var [N 1];
makeMultivariateSymFunctionFromInputVector(my_var,"my_func");
------
It also allows creation of multidimensional symbolic functions by just specifying the function_dimension, e.g. instead of:
syms my_func1(my_var1,my_var2,my_var3);
syms my_func2(my_var1,my_var2,my_var3);
syms my_func3(my_var1,my_var2,my_var3);
syms my_func4(my_var1,my_var2,my_var3);
syms my_func5(my_var1,my_var2,my_var3);
my_var = [my_var1;my_var2;my_var3];
my_func = [my_func1;my_func2;my_func3;my_func4;my_func5];
The function can be called:
N = 3;
syms my_var [N 1];
my_func = makeMultivariateSymFunctionFromInputVector(my_var,"my_func",5);
------
See the example m-file for more usage examples.

인용 양식

Imran Khan (2025). Multivariate symbolic math function from input sym vector (https://kr.mathworks.com/matlabcentral/fileexchange/167966-multivariate-symbolic-math-function-from-input-sym-vector), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2022a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.1

Fixed description.

1.0.0