01:198:107 Lecture Notes - Lecture 18: Golden Ratio, Matlab, Symbolic Integration
![](https://new-preview-html.oneclass.com/L7W93pro8dXxmologzMEj1VKzkbBJv2e/bg1.png)
CS 107: Lecture 18: Symbolic Matlab Toolbox
● Symbolic objects
○ Symbolic objects are a special MATLAB data type introduced by the
Symbolic
○ Math Toolbox software enable you to perform mathematical operations
○ In the MATLAB workspace analytically, without calculating numeric values
○ You can use symbolic objects to perform a wide variety of analytical
computations
● Symbolic variables
○ To declare variables x and y as symbolic objects use the syms command
○ Syms x y
○ You can manipulate the symbolic objects according to the usual rules of
mathematics
● Symbolic numbers
○ Symbolic Math Toolbox software also enables you to convert numbers to
symbolic objects
○ To create a symbolic number, use the sym command
● Create symbolic expressions
○ Suppose you want to use a symbolic variable to represent the golden ratio
○ The command phi=sym(‘(1+sqrt(5))/2’);
○ Achieves this goal, now you can perform various mathematical operations
phi
● Simplify symbolic expressions
○ You can simplify an answer by entering simplify(f) and get a very short
answer: ans=0
● Differentiate symbolic expressions
○ With the symbolic math toolbox software, you can find
■ Derivatives of single-variable expressions
■ Partial derivatives
■ Second and higher order derivatives
■ Mixed derivatives
Document Summary
Symbolic objects are a special matlab data type introduced by the. Math toolbox software enable you to perform mathematical operations. In the matlab workspace analytically, without calculating numeric values. You can use symbolic objects to perform a wide variety of analytical computations. To declare variables x and y as symbolic objects use the syms command. You can manipulate the symbolic objects according to the usual rules of mathematics. Symbolic math toolbox software also enables you to convert numbers to symbolic objects. To create a symbolic number, use the sym command. Suppose you want to use a symbolic variable to represent the golden ratio. Achieves this goal, now you can perform various mathematical operations phi. You can simplify an answer by entering simplify(f) and get a very short answer: ans=0. With the symbolic math toolbox software, you can find. To differentiate a symbolic expression, use the diff command.