presenting your data

18
Presenting your data Hugo Leblanc - November 4

Upload: dullin

Post on 06-Jan-2016

6 views

Category:

Documents


0 download

DESCRIPTION

Present your data in MATLAB

TRANSCRIPT

Page 1: Presenting Your Data

7/17/2019 Presenting Your Data

http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 1/18

Presenting your dataHugo Leblanc - November 4

Page 2: Presenting Your Data

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

Page 3: Presenting Your Data

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

Page 4: Presenting Your Data

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

Page 5: Presenting Your Data

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

Page 6: Presenting Your Data

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

Page 7: Presenting Your Data

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

Page 8: Presenting Your Data

7/17/2019 Presenting Your Data

http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 8/18

Graphics

• Plots

• Formating

• Exporting

Page 9: Presenting Your Data

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

Page 10: Presenting Your Data

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

Page 11: Presenting Your Data

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

Page 12: Presenting Your Data

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

Page 13: Presenting Your Data

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

Page 14: Presenting Your Data

7/17/2019 Presenting Your Data

http://slidepdf.com/reader/full/presenting-your-data-568c49375736a 14/18

Formating

• Title and labels

• Coordinate system

• Annotations

Page 15: Presenting Your Data

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

Page 16: Presenting Your Data

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

Page 17: Presenting Your Data

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

Page 18: Presenting Your Data

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