{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture21_slides - Overview of today Today Review of...

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

View Full Document Right Arrow Icon
Overview of today Today: Review of concepts from last time Visualizing data in Matlab - Functions vs. scripts - Introduction to clustering
Background image of page 1

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

View Full Document Right Arrow Icon
Plotting in Matlab Visualizing your data is important! Matlab supports almost any type of graph you can think of: Line plots: linear, log scale Bar plots Pie charts Histograms Contour plots 2-D mesh plots 2-D intensity plots Specialized statistical plots: boxplots, scatterplots, distribution plots (for interactive plotting tool, type „plottools‟)
Background image of page 2
Plotting in Matlab: Line plots How can we plot things like: y = f(x) ? >> plot(x_vector,y_vector); plots.m
Background image of page 3

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

View Full Document Right Arrow Icon
Plotting in Matlab: Line plots Changing line and marker properties: Change directly on figure object Click , then double-click on plotted line Or specify these properties in command: >> plot(x_vector,y_vector,’ - .dr’); plots.m <line><marker><color>
Background image of page 4
Plotting in Matlab: Line plots Plotting multiple functions on the same graph: >> plot(x_vector1,y_vector1,x_vector2,y_vector2); OR >> plot(x_vector1,y_vector1); >> hold on; >> plot(x_vector2,y_vector2);
Background image of page 5

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

View Full Document Right Arrow Icon
Plotting in Matlab: Line plots Plotting multiple functions on the same graph: plots.m
Background image of page 6
Plotting in Matlab: Line plots Other line plots similar parameters: plot3: 3-D x,y,z plotting loglog: log scales for both x,y axes semilogx: log scale x-axis with linear scale y semilogy: log scale y-axis with linear scale x plotyy: allows two y-axis labels for plotting two different- scaled functions over the same x axis simultaneously
Background image of page 7

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

View Full Document Right Arrow Icon
Saving and Exporting Plots To save a figure after plotting: save as Matlab .fig file: File->Save As export to an image: (1) File->Save As, choose image type (2) >>print(gcf,’ -d<driver- name>’,’ - r<resolution>’,’<outfile>’) (see for example of printing to a file) plots.m
Background image of page 8
More Plots: histograms hist_demo.m >> hist(<data_vector>,<num_bins>);
Background image of page 9

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

View Full Document Right Arrow Icon