{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture21_slides

# lecture21_slides - Overview of today Today Review of...

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

Overview of today Today: Review of concepts from last time Visualizing data in Matlab - Functions vs. scripts - Introduction to clustering

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

View Full Document
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‟)
Plotting in Matlab: Line plots How can we plot things like: y = f(x) ? >> plot(x_vector,y_vector); plots.m

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

View Full Document
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>
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);

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

View Full Document
Plotting in Matlab: Line plots Plotting multiple functions on the same graph: plots.m
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

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

View Full Document
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
More Plots: histograms hist_demo.m >> hist(<data_vector>,<num_bins>);

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

View Full Document