presenting your data
DESCRIPTION
Present your data in MATLABTRANSCRIPT
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 1/18
Presenting your dataHugo Leblanc - November 4
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 2/18
Presenting your data• Data management
• Importing/Exporting data
• File operations
• Spreadsheets
• Images
• Graphics
• Plots
• Formating
• Exporting
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 3/18
Data management
• Importing/Exporting data
• File operations
• Spreadsheets
• Images
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 4/18
Importing/Exporting data
• Workspace variables can be imported and
exported between sessions
• MAT files are used to store the variables inside
an external file
• save and load are used to handle importing and
exporting workspace variables
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 5/18
File Operations
• You can access text files with MATLAB
• importdata can directly read a text file and
generate an array with the revenant information
(or uiimport to have a GUI helper)
• To deal directly with files, you need to open the
file with open to get a file identifier (FileID). A file
identifier is a token that represents the file to
other functions
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 6/18
Spreadsheets (Excel)
• MATLAB includes functions to directly import/ export data to .xlsx files
• xlsread and xlswrite are used to deal directly
with Excel files
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 7/18
Images
• Images can be converted into a matrix of data
inside of matlab
• imformats displays which image format MATLAB
can handle and their respective function names
• imread and imwrite are use to import/export
image data inside of MATLAB
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 8/18
Graphics
• Plots
• Formating
• Exporting
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 9/18
Plots
• Basics
• Line plots
• Pie charts, Bar plots and histograms
• Surfaces
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 10/18
Plots basics
• MATLAB uses figures to display graphics
• Multiple figures can be used at once, with only
one being the 'selected' one
•
The functions figure can open blank displays
• close is used to close figures
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 11/18
Line plots
• plot - 2-D Line plot
• plotyy - 2-D Line plot with different y axis
• plot3 - 3-D Line plot
• loglog - Log-log scale plot
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 12/18
Pie charts, Bar plots and
histograms• bar - bar graph
• bar3 - 3-D bar graph
• pie/pie3 - pie chart
• hist - Histogram plot
• histc - Histogram bin count plot
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 13/18
Surfaces
• surf - Surface 3-D plot
• surfc - Surface 3-D plot with contours
• mesh - mesh plot
• meshc - mesh plot with contours
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 14/18
Formating
• Title and labels
• Coordinate system
• Annotations
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 15/18
Title and labels
• title, xlabel, ylabel, zlabel - Label the different
axes
• legend - add legend for lines
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 16/18
Coordinate system
• xlim, ylim, zlim - Limits the bords of a figure
•
box - Displays the boundary of limits
• grid - Displays inside grid in figures
• subplot - Create multiple plots inside the same
figure
• hold - Retain graph when adding new graphs
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 17/18
Annotations
• annotation - Create a text box inside the figure
• text - Annotate points in the graph
• ginput - Input a selection from a graph
7/17/2019 Presenting Your Data
http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 18/18
Exporting
•
print - prints the current figure
• savefig - Save the figure under the MATLAB .ifg
format
• saveas - Save the figure as an image