What Is a Data File and How Do You Generate It in MATLAB?

  • Context: MATLAB 
  • Thread starter Thread starter balogun
  • Start date Start date
  • Tags Tags
    Data File Matlab
Click For Summary

Discussion Overview

The discussion revolves around the concept of a data file in MATLAB, specifically focusing on how to generate such a file and analyze it. The context is primarily homework-related, as a participant seeks clarification on the requirements for an upcoming retake involving data file generation.

Discussion Character

  • Homework-related
  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant expresses confusion about what constitutes a data file and how to generate it in MATLAB, indicating that the help function was not useful.
  • Another participant critiques the vagueness of the initial question, emphasizing the need for specific details about the type of data file required.
  • A later reply suggests that the participant should provide an example of the data file they need, noting that data files can vary significantly in format and content.
  • Further clarification is requested regarding the nature of the data, including its type (e.g., sound, image, random signal) and structure (e.g., number of columns, data types).
  • One participant provides a starting point for generating a data file in MATLAB, mentioning the use of the fopen function for file output.

Areas of Agreement / Disagreement

Participants generally agree that more specific information is necessary to provide useful assistance. However, there is no consensus on the exact requirements for generating a data file, as the initial poster has not clarified the type of data needed.

Contextual Notes

Limitations include the lack of specific details about the data file format and content, which affects the ability to provide targeted guidance. The discussion also highlights the variability in data file types and the corresponding methods for generation in MATLAB.

balogun
Messages
14
Reaction score
0

Homework Statement



I have a retake in MATLAB and in my briefing they said i will have to generate a data file and analyse it.Can someone please tell me what a data file is and how you generate it.
I have used the help function in MATLAB but did not find it very useful .
Thanks in advance.

Homework Equations





The Attempt at a Solution


Used help function but not useful.
 
Physics news on Phys.org
Your question is so hopelessly vague that no one here will be able to help you with it. MATLAB includes many functions that can be used to generate data sets, but you've given us absolutely no information on the kind of data you want. It also includes functions which can be used to write arrays out to files on the disk.

- Warren
 
...

Sorry didn't know there were many different kinds of datafiles.I don't really know the type of datafile his going to give so i thought there should be some kind of general method.But from the last coursework i was given he asked for an ascii datafile.
 
Is the data supposed to be a sound, or a picture, or a one-dimensional random signal? What's the distribution supposed to look like? What's the meaning of the data? Is it supposed to be one column in a text file or twelve? One point or ten billion points? Floating-point or fixed-point or integers?

You've given us no information at all about how to help you. It's as if you went into a library and told the librarian you were looking for "a book."

- Warren
 
As chroot has mentioned, it would be helpful if you described an example.

A data file , as you have described it, is information that can be 'used by' (input) or 'generated by' (output) a computer program.

Since you want to generate a data file, you are interested in input/output syntax. That's true for any computer language, however for MATLAB it may begin with something like ---> FID_out=fopen('test_io.dat",'w');
Here's http://ocw.mit.edu/NR/rdonlyres/025D2855-5E98-42A6-A415-B408855187CE/0/tutorial05.pdf that illustrates this concept.
 
Last edited by a moderator:

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K