Practical 7

Solving Equations

The Symbolic Toolbox can be used to find solutions for single or simultaneous equations using the solve command.

Solving a Single Equation

The first task is to solve a single equation  for the variable , with the result stored in the variable a. This can be done with command solve.

a = solve(f,x)

> Exercise: Using solve for a Single Equation

> Go through and type in the code for the following steps to solve the single equation.

> Watch out! There is an error that you will need to correct!!

1. Decide what is (you will need to rearrange the equation)

In this case

2. Create a symbolic variable syms x
3. Create a symbolic variable by assigning a symbolic expression to it f=10/(x^3+1)-4+2x
4. Solve u = solve(f,x)