From the course: Accelerated MATLAB
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Challenge: 3D sinewave and animated parameter shift - MATLAB Tutorial
From the course: Accelerated MATLAB
Challenge: 3D sinewave and animated parameter shift
(catchy music) - [Instructor] The challenge for this chapter will be to create a code to produce a 3D animated sine wave with changing amplitude. This one has two parts. Part one will be static 3D plot of sine wave where you have to plot a 3D sine wave using MATLAB's plot3 function. And then define variables. Create an X vector ranging from zero to four pi by using linspace. Compute y as the sine of x. Define z as a linearly spaced vector from zero to one. And then the third part is customize your plot. Use plot3, x, y, z, with blue color, LineWidth of two to create the plot. Add labels to the X, Y, and Z axes using xlabel, ylabel, and zlabel. Add a descriptive title. Enable grid lines with grid on and adjust the axes with axis tight to ensure a clean visualization. Next, part two will be animated sine wave with amplitude change. Create an animated sine wave. You start with a fresh figure and set up the basic plot with x and ylabels and the title. Then set up an animation loop that…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Advanced 2D plotting: Parabolas6m 15s
-
(Locked)
Advanced 2D plotting: Current signals5m 9s
-
(Locked)
3D graphics and visualization8m 48s
-
(Locked)
Interactive and animated plots7m 14s
-
(Locked)
Customizing graphs for publication9m 23s
-
(Locked)
Challenge: 3D sinewave and animated parameter shift2m 7s
-
(Locked)
Solution: 3D sinewave and animated parameter shift8m 39s
-
-