主要内容

本页翻译不是最新的。点击此处可查看最新英文版本。

符号变量、表达式、函数和预设项

创建符号变量、表达式、函数并设置预设项

Symbolic Math Toolbox™ 引入了“符号对象”这种特殊的数据类型。此数据类型包括符号数、符号变量、符号表达式和符号函数。它还包括符号数、变量、表达式和函数的向量、矩阵和多维数组。在计算中使用符号对象意味着 MATLAB® 必须以解析方式而非数值方式执行这些计算。符号计算精确,不易出现舍入误差。有关符号对象的详细信息,请参阅Use Symbolic Objects to Represent Mathematical Objects。有关创建符号变量、表达式和函数的快速指南,请参阅Create Symbolic Numbers, Variables, and Expressions创建符号函数

函数

全部展开

syms创建符号标量变量和函数以及矩阵变量和函数
symCreate symbolic variables, expressions, functions, matrices
symfun创建符号函数
symmatrixCreate symbolic matrix variable (自 R2021a 起)
symmatrix2symConvert symbolic matrix variable to array of scalar variables (自 R2021a 起)
symfunmatrixCreate symbolic matrix function (自 R2022a 起)
symfunmatrix2symfunConvert symbolic matrix function to symbolic function (自 R2022a 起)
str2symEvaluate string representing symbolic expression
foldCombine (fold) vector using function
piecewiseConditionally defined expression or function
symvarFind symbolic variables in symbolic input
argnames符号函数或矩阵函数的输入变量
formulaReturn body of symbolic function or matrix function
hasCheck if expression contains particular subexpression
childrenSubexpressions or terms of symbolic expression
symTypeDetermine type of symbolic object
symFunTypeDetermine functional type of symbolic object
isSymTypeDetermine whether symbolic object is specific type
hasSymTypeDetermine whether symbolic object contains specific type
findSymTypeFind symbolic subobjects of specific type
mapSymTypeApply function to symbolic subobjects of specific type
isfiniteCheck whether symbolic array elements are finite
isinfCheck whether symbolic array elements are infinite
isnanCheck whether symbolic array elements are NaNs
symprefSet symbolic settings

主题