write a script that will read from a file x and y


Write 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
x  2.2  y  6
x  3.4  y  7.4

The format of each line in the file is the letter 'x', a space, the x value, space, the letter 'y', space, and the y value.  First, make the data file with 10 lines in this format.  Do this by using the Editor or 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 every line as a string.  In the loop, it makes x and y vectors for the data points.  After the loop, it plots these points and attempts to close the file.  The script should print whether or not the file was effectively closed. 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: write a script that will read from a file x and y
Reference No:- TGS0217608

Expected delivery within 24 Hours