21 - 2D and 3D Data Representation - Full

21 - 2D and 3D Data Representation - Full - Click to edit...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Click to edit Master subtitle style Engineering 101 2D/3D Data Representation Quote of the Day- Mahatma Gandhi Freedom is not worth having if it does not include the freedom to make mistakes. Plotting Data in MATLAB n To plot data use the function plot(x, y) n x is a vector of x values n y is a vector of y values x = 1:0.1:10; y = x .^ 2 – 10 .* x + 15; plot(x, y); Plotting Data in MATLAB n To add a title to a graph use the function title( ) n To add x and y axis labels use the functions xlabel( ) and ylabel( ) n To add a grid to the graph use the grid function title(‘A Parabola’); xlabel(‘x – value’); ylabel(‘y – value’); grid on; Plotting Data in MATLAB n You can print your graph by using the menus or by typing print n To output your graph to a TIFF file you can use the command print –dtiff filename Plotting Data in MATLAB n Multiple data sets can be plotted on the same graph x = 0:0.1:10; y1 = x .^2 – 10 .* x + 15; y2 = - x.^2 + 10 .* x; plot(x, y1, x, y2); Plotting Data in MATLAB n To distinguish between the two plots you can enter codes to set the line color, style, and marker style. color marker style line style y = yellow . = point o = circle- = solid m = magenta x = x-mark + = plus : = dotted c = cyan s = square d = diamond -. = dash-dot r = red * = star p = pentagram -- = dashed Plotting Data in MATLAB n Multiple data sets can be plotted on the same graph n Here one will be red and dot-dashed, and the other will be blue and marked with circles n A legend is created with the legend function x = 0:0.1:10;x = 0:0....
View Full Document

{[ snackBarMessage ]}

Page1 / 32

21 - 2D and 3D Data Representation - Full - Click to edit...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online