sym2fhandle
バージョン 1.0.0 (3.17 KB) 作成者:
Marko Neitola
Convert a symbolic object X with variables a1,a2,a3,...,aN to a function handle (anonymous function) hX(a), where a=[a1,a2,a3,...,aN].
Convert a symbolic object X with variables a1,a2,a3,...,aN to a function handle hX. The handle hX can evaluated by hX(a), where "a" is an array of variables a=[a1,a2,a3,...,aN]. A function handle hX is an anonymous function (not stored in a program file).
There are two distinct variations in the usage of SYM2FHANDLE:
1. Symbolic object X has N variables a1,a2,a3,...,aN.
For an object X(a1,a2,a3,...,aN), SYM2FHANDLE converts X to hX(a), where the input a is an array with the length of N.
2. Symbolic object X has N variables and a domain variable.
For an object e.g. X(a1,a2,a3,...,aN,w), SYM2FHANDLE converts X to hX(a,w). Here, w is a "domain". Domain can be e.g. time, frequency or complex frequency variable (s or z).
SYM2FHANDLE outputs a function handle and an element-wise version of the function handle. The latter can be used to evaluate domain as an array. A good example would be generating a frequency response of a transfer function.
The class of the array and domain can be anything that MATLAB can evaluate. For instance, if the domain is an LTI object, the variable array cannot be symbolic.
The possibilities of SYM2FHANDLE are endless, but here's my favourite: For an equation (or a system of equations) converted to a handle hX, you can use the handle as a target function to optimization toolbox function such as FSOLVE or LSQNONLIN. The outcome is the optimized values of a1,a2,a3,...,aN.
引用
Marko Neitola (2024). sym2fhandle (https://www.mathworks.com/matlabcentral/fileexchange/131219-sym2fhandle), MATLAB Central File Exchange. に取得済み.
MATLAB リリースの互換性
作成:
R2023a
R14SP1 以降のリリースと互換性あり
プラットフォームの互換性
Windows macOS Linuxタグ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!バージョン | 公開済み | リリース ノート | |
---|---|---|---|
1.0.0 |