Practical 7

Example

 

> Exercise: Another Example of Solving Symbolic Equation

> Solve the general quadratic equation  for any x by making the three coefficients and symbolic variables.

syms a b c x

> Instead of creating a new variable f for function, use the following command to solve directly:

soln = solve(a*x^2+b*x+c)

 

The above command doesn’t specify the variable to solve for. If it is not specified, the solve command will:

1) Solve for x by default or

2) Solve for the last alphabetical variable if there is no variable called x or

3) Solve for the only symbolic variable if there is only one.

> Exercise

> Solve the equation again, replacing with , with , with and with .

syms u v w s

...

> What is the answer this time?