To create:
A script that will read from a file x and y data points in the following format:
x 0 y 1
x 1.3 y 2.2
Year | Population |
1920 | 4021 |
1940 | 8053 |
1960 | 14994 |
1980 | 9942 |
2000 | 3385 |
The format of every line in the file is the letter ‘x’, a space, the x value, space, the letter ‘y’, space, and the y value. First, create the data file with 10 lines in this format. Do this by using the Editor/Debugger, then File Save As xypts.dat. The script will attempt to open the data file and error-check to make sure it was opened. If so, it uses a for loop and fgetl to read each line as a character vector. In the loop, it creates x and y
Want to see the full answer?
Check out a sample textbook solutionChapter 9 Solutions
MATLAB: A Practical Introduction to Programming and Problem Solving
- Algebra: Structure And Method, Book 1AlgebraISBN:9780395977224Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. ColePublisher:McDougal LittellMathematics For Machine TechnologyAdvanced MathISBN:9781337798310Author:Peterson, John.Publisher:Cengage Learning,Elementary Geometry For College Students, 7eGeometryISBN:9781337614085Author:Alexander, Daniel C.; Koeberlein, Geralyn M.Publisher:Cengage,
- Algebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:Cengage