What are symbolic variables?
40 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I don't really understand what they are and why they're needed. I also couldn't find anything about this in the documentary.
Antworten (1)
Walter Roberson
am 17 Jan. 2017
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 Kommentar
Walter Roberson
am 17 Jan. 2017
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
Siehe auch
Kategorien
Mehr zu Assumptions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!