Need Help ?

Home / Expert Answers / Other / part-1-matlab-graphics-2d-create-a-2d-graph-by-plotting-multiple-data-series-on-the-sameaxes-using-a

(Answered): PART 1 – MATLAB Graphics (2D)Create a 2D graph by plotting multiple data series on the sameaxes, u ...



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.PART 1 - MATLAB Graphics (2D) Create a 2D graph by plotting multiple data series on the same axes, using a resolution of at lPART 4 - GUI for Interactive plots MATLABAN In this part, you are going to create a Graphical User Interface (GUI) using MATL

PART 1 - MATLAB Graphics (2D) Create a 2D graph by plotting multiple data series on the same axes, using a resolution of at least 0.2 between points. Choose your axis limits so that all three mathematical functions show at least 2 full iterations. Ensure all axes are labelled, and each data series has a different line style, marker and colour. y1 = f(x) = 2sin(x) y2 = f(x) = cos(2x) • y3 = f(x) = tan(x/2) PART 2 - MATLAB Graphics (3D) Using the surface plot approach for plotting functions in two variables (see meshgrid and surf), plot the following two functions, using a resolution of at least 0.5 between points, from - 10 to 10. Plot both functions side-by-side, as subplots on the same figure. Ensure all axes are labelled. • z=f(x,y) = x2 - y2 • z = f(x, y) = x y x2+y? PART 3 - Logarithmic and Polar plots Figure Pe to view linsert Tools Desktop Window Help yox (normal axes yox?) [logy axis) 102 107 To demonstrate the use of both logarithmic plots and polar coordinates, create a figure with three plots as shown, right. Firstly, plot the function y = x² on normal axes alongside the function y = ex? where the y-axis is logarithmic. Add appropriate titles. You may want to investigate the MATLAB documentation for the function semilogy(). Below these two plots, use a single polar coordinate system to draw a blue 4-leaf rose curve with the equation p= sin() cos(). Then, add a red 12-leaf rose curve to the same plot. The MATLAB tutorial for the function polarplot () will help get you started. 10 2 Polar Coordinates OS 04 150 02 180 PART 4 - GUI for Interactive plots MATLABAN 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 - the online tutorial introduction to App Designer. Function Plot Sino 08 061 Co 0 64 Three ye 001 The GUI you need to create will show the three trigonometic functions sin(), cos () and tan () based on button presses. A drop down menu for number of cycles to draw is also required. An example of what the GUI may look like is shown, right. You will need to add callbacks to the three buttons and create each plot inside the callback. You do not need to add a callback to the drop down menu item – the axes need only update when a button is pressed. PART 5 - BONUS Problem For this part, you will need to create a moving plot of a sine wave. During the animation, ensure that 2 full iterations of the sine wave are visible at all times. Your sine wave should shift left 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 the video in the workshop6 zipped file on Moodle.


We have an Answer from Expert

View Expert Answer

Expert Answer


Answer to PART 1 – MATLAB Graphics (2D) Create a 2D graph by plotting multiple data series on the same axes, using a resolution...

The Problem has Answer!

We have detailed solutions for you for more understanding.

View Answer