Assignment title: Information
Q1. Evaluate the following sum of fractions using symbolic maths in MATLAB.
Display the answer as a fraction. Use pretty function to display the output.
11
3
19
17
7
1
Q2. Using the symbolic maths toolbox (not using the command roots), solve the
following equation:
Display your answer in decimal format (not as fractions or as sum of numbers).
Q3. Given the function
(a) Plot the function y(x) using ezplot for -4 x 4.
(b) Obtain the function
Display the output using pretty command.
(c) Plot the function y1(x) using ezplot for -4 x 4 (use top half of a figure for
Q3.(a) and the bottom half for Q3.(c)).
(d) Obtain the minima and maxima of the function y(x) [Hint: solve y1(x) = 0].
Display your outputs clearly in decimal format (not as fractions or as sum of
numbers).
Q4. (from MATALB: An Introduction with Applications by Gilat)
Define x and y as symbolic variables and create the two symbolic expressions
Use symbolic operations to determine the simplest form of S × T. Use the subs
command to evaluate the numerical value of the result for x = 9 and y = 3.
Q5. Consider the following set of three equations:
3 + 11x
6x
2 − 9x + 7 = 0
y(x) =
2
( ) ( )
y x
1
2 + 2x + 10)x
(x
2 + 2)
(x
d
using symbolic differentiation of y(x).
y x
dx
S = x + √xy
and T = √x − y
4
2 + y
2
.
3x1 + 2x2 −
5x1 − 2x2 +
x1 + 6x2 + 3x3 = 17
x3 = 12
2x3 = 5
Define a symbolic variable for each of the unknown, and use MATLAB's symbolic
capability to solve each unknown.
Q6. (from MATLAB for Engineers by H Moore, 3rd
Use the following equation to create a symbolic function Z:
Edition)
Z =
sin(√X2 + Y2)
√X2 + Y2
(a) Use the ezmesh plotting function to create a three-dimensional plot of Z.
(b) Use the ezsurf plotting function to create a three-dimensional plot of Z.
(c) Use the ezcontour to create a contour map of Z.
(d) Generate a combination of surface and contour plot of Z, using ezsurfc.
Use subplots to put all the graphs you create into the same figure.