Many scientists and engineers use Matlab, a software application developed by Mathworks, to analyse small and large numerical data sets. They then visualise them onscreen using, for example, scatter, line and contour plots, with Matlab's extensive graphing functions. In addition to plotting numerical data, scientists and engineers use Matlab to plot equations. If you have a line described by three variables, you may need to plot it in three dimensions to help you understand the equation more thoroughly.
- Skill level:
- Moderately Easy
Type "z = 0:(pi/100):(20*pi)" in the command window to generate a series of points along the z-axis.
Type "x = cos(z)" to calculate the position of each z value on the x-axis.
Type "y = sin(z)" to calculate the position of each z value on the y-axis.
Type "plot 3(x,y,z)" to plot each of the points as a line -- a 3-D helix -- on a 3-D plot..
Type "xlabel('cos(z)'), ylabel('sin(z)'), zlabel('z')" to label the axes.
Type "grid on" to show grid lines.
Tips and warnings
- You can change the appearance of the line using the "linespec" line specification string syntax. Add the linespec string to the end of the plot 3 function arguments. For example, type "plot 3(x,y,z,'--or)" to plot a dashed line with circles at each point and colour both the line and markers red. Refer to the linespec documentation for all the different styles available.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for