What are symbolic variables?
59 ビュー (過去 30 日間)
古いコメントを表示
I don't really understand what they are and why they're needed. I also couldn't find anything about this in the documentary.
回答 (1 件)
Walter Roberson
2017 年 1 月 17 日
A symbolic variable can hold an expression instead of just a numeric value. For example it can hold the expression sin(x^2+1) . The symbolic toolbox can reason about the expressions, such as finding the solution to equations, or such as doing calculus. For example,
syms x
diff(sin(x^2+1),x)
comes out as 2*x*cos(x^2 + 1)
This can be used to create and manipulate formula instead of having to work with specific numeric values.
Symbolic variables are not restricted to integers or floating point numbers, so the toolbox can reason about irrational values with full theoretic precision. For example,
>> symsum(1/x^2,x,1,inf)
ans =
pi^2/6
1 件のコメント
Walter Roberson
2017 年 1 月 17 日
Also symbolic numbers can have a higher precision than hardware numbers so you can compute to more decimal places. The trade off is that symbolic computations need more memory and are slower than hardware computation
参考
カテゴリ
Help Center および File Exchange で Assumptions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!