

5.1 Solving Algebraic Equations With a Single Variable.4.2 Using Functions with Symbolic Matrices as Inputs.4.1 Substituting Values into Symbolic Variables.1 Introduction to the Symbolic Math Toolbox.In each of the following cases the symbolic expression in the middle column results from the corresponding sym command, while the last column results if you then apply the double(.) command to each symbolic value in the middle column: sym(11/13)Īlternative formats can be viewed by entering help sym. Conversely, the double function converts a symbolic number back into a double-precision value in MATLAB. The sym function converts the argument into a symbolic expression in “Maple”. If this is not possible, a real number will be approximated by a fraction of large integers. The default format is an integer or rational fraction. Numbers can be held in various possible formats in “Maple”. Often in the “Maple” help menu you will still see the single quotation formulation but it is recommended you ignore it wherever possible to avoid confusion. This notation for constructing a symbolic expression using single quotation marks is still valid in many parts of “Maple” although it is being phased out because MATLAB already uses single quotation marks in other situations. Note that in earlier versions of Matlab the first two lines above were equivalent to the single command y=’x^2-5/x’. You notice that no attempt has yet been made to simplify z. Z=y*x-8 % z is automatically another symbolic variable Y=x^2-5/x % y is automatically another symbolic variable

Enter the following and examine the output: The simplest way to enter “Maple” is to make one or more variables into symbolic symbol(s) using the syms command. The interface between Matlab and “Maple” is smooth and it is easy to move in and out of this Symbolic Math Toolbox. For convenience only in this guide we will refer to the smaller Symbolic Math Toolbox attached to Matlab as “Maple”. The tools in the Symbolic Math Toolbox are built upon the core of the powerful software program called Maple® which is used in many universities in Australia and overseas. You will be solving and computing with mathematical symbols rather than numbers. Each expression can be given a variable name (also symbolic) thereby allowing algebraic, trigonometric and other functional manipulations and simplifications as well as permitting differential and integral calculus. However, commands in the Symbolic Math Toolbox enable you to enter formulae such as sin(2*x), x*exp(x), x^2+3*atan(x), cos(x)^2+sin(x)^2, etc, where x is a symbolic variable. For example if you merely enter the single command sin(x) after the prompt you receive the error message A variable x must have a numerical value (or array values) before expressions involving x can then be evaluated.

In all previous sections of this introduction MATLAB has been used as a powerful programmable graphics calculator.
