file_input_output

file_input_output - MATLAB File Input and Output Greg...

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

View Full Document Right Arrow Icon
MATLAB File Input and Output Greg Reese, Ph.D Research Computing Support Group Academic Technology Services Miami University
Background image of page 1

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

View Full DocumentRight Arrow Icon
MATLAB File Input and Output © 2010 Greg Reese. All rights reserved 2
Background image of page 2
3 Output Convenient to store output in file Creates record of work Easier than copying output by hand Can edit with text or MATLAB editor Can turn in homework
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Special File Formats Will list special formats but not go into details. All formats have functions to read and write unless otherwise noted. See help for more info Audio AU, SND: NeXT/Sun WAV: Microsoft Wave
Background image of page 4
5 Special File Formats Extended Markup Language (XML) Image many formats, including BMP, GIF, JPEG, PNG, TIFF Spreadsheets XLS: Excel WK1: Lotus
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Special File Formats Scientific data CDF: Common Data Format FITS: Flexible Image Transport System* HDF: Hierarchical Data Format* H5: HDF or HDF-EOS, version 5 NC: Network Common Data Form * No writing
Background image of page 6
7 Special File Formats Video – reading only Windows MPG: Motion Picture Experts Group ASF, ASX, WMV: Windows Media other: Any format supported by Microsoft DirectShow Linux Formats supported by your installed GStreamer plug-ins, including .ogg * Mac MPG, MP4, M4V: MPEG-1 and MPEG-4 other: Formats supported by QuickTime, including .mov, .3gp, .3g2, and .dv
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 Text Quite a few ways to read and write text. Will divide as follows: High level – read or write in one shot Low level – read or write with many function calls
Background image of page 8
9 High Level Text Pros Convenient Can easily work with common objects, e.g., matrices One call to read or write Cons Inflexible Fixed format
Background image of page 9

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

View Full DocumentRight Arrow Icon
10 Delimited Files Characters that separate the columns in a row are called delimiters . Whitespace characters are common delimiters Spaces (blanks) Sequential spaces usually treated as one delimiter Tabs Sequential tabs usually treated as multiple delimiters
Background image of page 10
11 Whitespace Delimiters Whitespace delimited numbers Read with load and save Any number of rows Each row must have same number of columns Lines starting with percent sign (%) treated as comments (ignored) Non-comment text must be numeric
Background image of page 11

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

View Full DocumentRight Arrow Icon
12 Whitespace Delimiters a = load( filename, '-ascii' ) Loads numbers from text file, ignores comment lines, stores result in matrix variable All rows merged into one matrix Any filename with extension other than .mat treated as ASCII, so for those don't need second argument Lines starting with percent sign (%) treated as comments (ignored) Sequential delimiters treated as one
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 46

file_input_output - MATLAB File Input and Output Greg...

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

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