Question

Matlab program A software package writes data to file that includes curly braces around each line...

Matlab program

A software package writes data to file that includes curly braces around each line and commas separating the values. For example, the data file, mn.txt, looks like this:

            {65.574,43.874}

{84.913,76.552}

{93.399,79.520}

{67.874,18.687}

{75.774,48.976}

{74.313,44.559}

{39.223,64.631}

{65.548,70.936}

{17.119,75.469}

{70.605,27.603}

{27.692,65.510}

{82.346,49.836}

{69.483,95.974}

{31.710,34.039}

{95.022,58.527}  

Read the data from the file mn.txt. Create a matrix that contains only the numbers and write this three-column matrix of reals to a new file.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

initially mn.txt file is read and number of lines in the file are counted.. then by updating the current line status, numbers are read using for loop and then stored to data file in excel format. and the resulting output is as below

Add a comment
Know the answer?
Add Answer to:
Matlab program A software package writes data to file that includes curly braces around each line...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a class named SatData that reads a JSON file containing data on 2010 SAT results...

    Write a class named SatData that reads a JSON file containing data on 2010 SAT results for New York City and writes the data to a text file in CSV (comma-separated values) format. It just needs to read a local JSON file - it doesn't need to access the internet. Specifically, your class should have an init method that reads the file, and it should have a method named save_as_csv that takes as a parameter a list of DBNs (district...

  • USING MATLAB SOFTWARE writing a script 2) A file called "hightemp.txt" was created some time ago...

    USING MATLAB SOFTWARE writing a script 2) A file called "hightemp.txt" was created some time ago which stores, on every line, a year followed by the high temperature at a specific location for each month of that year. For example, the file might look like this: 89 42 49 55 72 63 68 77 82 76 67 90 45 50 56 59 62 68 75 77 75 66 91 44 43 60 60 60 65 69 74 70 70 As...

  • ( IN JAVA): Write a program that reads each line in a file, and writes them...

    ( IN JAVA): Write a program that reads each line in a file, and writes them out in reverse order into another file. This program should ask the user for the name of an input file, and the name of the output file. If the input file contains: Mary had a little lamb Its fleece was white as snow And everywhere that Mary went The lamb was sure to go Then the output file should end up containing: The lamb...

  • Write a program that writes a series of random numbers to a file. Each random number...

    Write a program that writes a series of random numbers to a file. Each random number should be in the range of 1 through 500 inclusive. 1.Use a file called randoms.txt as a input file and output file a. If you go to open the file and its not there then ask the user to create the file     and then quit 2. Ask the user to specify how many random numbers the file will hold. a.Make sure that the...

  • In C program Consider a file that contains employee records, called "empstat.txt." The data for each...

    In C program Consider a file that contains employee records, called "empstat.txt." The data for each employee consist of the employee’s last name (up to 20 characters), employee id number (up to 11 characters), gross pay for the week (double), taxes deducted (double) for the week, and net pay (double) for the week. Create a struct to hold the employee information. Write a void function called writeEmpFile that prompts the user to enter last name, id number, gross pay and...

  • Capitalization JAVA In this program, you will read a file line-by-line. For each line of data...

    Capitalization JAVA In this program, you will read a file line-by-line. For each line of data (a string), you will process the words (or tokens) of that line one at a time. Your program will capitalize each word and print them to the screen separated by a single space. You will then print a single linefeed (i.e., newline character) after processing each line – thus your program will maintain the same line breaks as the input file. Your program should...

  • Description: Create a program called numstat.py that reads a series of integer numbers from a file...

    Description: Create a program called numstat.py that reads a series of integer numbers from a file and determines and displays the name of file, sum of numbers, count of numbers, average of numbers, maximum value, minimum value, and range of values. Purpose: The purpose of this challenge is to provide experience working with numerical data in a file and generating summary information. Requirements: Create a program called numstat.py that reads a series of integer numbers from a file and determines...

  • 1. Write a C++ program that reads daily weather observation data from a file and writes...

    1. Write a C++ program that reads daily weather observation data from a file and writes monthly and annual summaries of the daily data to a file. a. The daily weather data will be contained in a file named wx_data.txt, with each line of the file representing the weather data for a single day. b. For each day, the date, precipitation amount, maximum temperature, and minimum temperature will be provided as tab-separated data with the following format: 20180101 0.02 37...

  • According to Wikipedia , a comma-separated values (CSV) file is a delimited text file that uses...

    According to Wikipedia , a comma-separated values (CSV) file is a delimited text file that uses a comma to separate values. A CSV file stores tabular data (numbers and text) in plain text. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. The use of the comma as a field separator is the source of the name for this file format. A company has text data that is not...

  • The picture is given in a PPM file and your program should put the converted one...

    The picture is given in a PPM file and your program should put the converted one into another PPM file. •Use argv[1] for the given file and argv[2] for the converted file.In addition, you can use a temporary file called tmp.ppm. •The number of rows and columns are not fixed numbers. •The converted file should also follow the PPM format with the above simplification, and can be converted subsequently. •Read the pixel matrix into a buffer. •For each row i(...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT