This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Next Previous Click to edit Master subtitle style Section 5.8: Reading From Formatted Files Section 5.8: Reading From Formatted Files 11 Skipping text when using the load function Using fscanf Section 5.8: Reading From Formatted Files Next Previous Section 5.8: Reading From Formatted Files Section 5.8: Reading From Formatted Files 22 The command load filename.txt, loads an entire file into a matrix variable called filename To skip text in a file, start the line with a % sign % is a comment command, the equivalent of // in C++ One limitation for data files is that all the data rows must have the same number of columns Note: separate numbers with blanks, not commas Here, we use an example file called points.txt : A file listing numbered map points, each with an x and y location Here, we will use this file to illustrate loading a file with text Later, we use this file again with a MATLAB program map.m....
View Full Document
This note was uploaded on 05/19/2008 for the course ENGR 25 taught by Professor All during the Spring '08 term at Lehigh University .
- Spring '08