PART 1 – MATLAB Graphics (2D)
Create a 2D graph by plotting multiple data series on the sameaxes, using a resolution of at least 0.2 between points. Chooseyour axis limits so that all three mathematical functions show atleast 2 full iterations. Ensure all axes are labelled, and eachdata series has a different line style, marker and colour.
????????1 = ????????(????????) = 2sin(????????)
????????2 = ????????(????????) = cos(2????????)
????????3 = ????????(????????) = tan(?????????2)
PART 2 – MATLAB Graphics (3D)
Using the surface plot approach for plotting functions in twovariables (see meshgrid and surf), plot the following twofunctions, using a resolution of at least 0.5 between points, from-10 to 10. Plot both functions side-by-side, as subplots on thesame figure. Ensure all axes are labelled.
• ????????=????????(????????,????????)=????????2?????????2
• ????????=????????(????????,????????)=????????????????????????2?????????2
????????2+????????2
PART 3 – Logarithmic and Polar plots
To demonstrate the use of both logarithmic plots and polarcoordinates, create a figure with three plots as shown, right.
Firstly, plot the function ???????? = ????????
2
axes alongside the function ???????? = ????????????????2 where the y-axis islogarithmic. Add appropriate titles. You may want to investigatethe MATLAB documentation for the functionsemilogy().
Below these two plots, use a single polar coordinate system todraw a blue 4-leaf rose curve with the equation
???????? = sin(????????) × cos(????????).
Then, add a red 12-leaf rose curve to the same plot. The MATLABtutorial for the function polarplot()will help get you started.
on normal
PART 4 – GUI for Interactive plots
In this part, you are going to create a Graphical User Interface(GUI) using MATLAB’s App Designer. If you have not already done so,you may want to perform the tasks in Practical 6, Part 4 - theonline tutorial introduction to App Designer.
The GUI you need to create will show the three trigonometicfunctions sin(),cos() and tan() based on button presses. A dropdown menu for number of cycles to draw is also required. An exampleof what the GUI may look like is shown, right.
You will need to add callbacks to the three buttons and createeach plot inside the callback. You do not need to add a callback tothe drop down menu item – the axes need only update when a buttonis pressed.
PART 5 – BONUS Problem
For this part, you will need to create a moving plot of a sinewave. During the animation, ensure that 2 full iterations of thesine wave are visible at all times. Your sine wave should shiftleft for 2 iterations, stop, and then shift right for 2 iterations.At each point, you should update the plot title as well.
For an example of how your moving plot should look, see thevideo in the workshop6 zipped file on Moodle.