Reading from a file, MATLAB Programming

Reading from a File:

A file has been once created; it can be read into a matrix variable. When the file is a data file, the load function will read from the file filename.ext (example, the extension may be .dat) and generate a matrix with similar name as the file. For illustration, if the data file testfile.dat had been generated, this would read from it:

>> clear

>> load testfile.dat

>> who

Your variables are:

testfile

>> testfile

testfile =

Note: The load command works only if there are similar numbers of values in each line, so that the data can be stored in a matrix and the save command only writes from the matrix to a file. If this is not the situation, the lower-level file I/O functions should be used.

 

Posted Date: 10/18/2012 7:09:29 AM | Location : United States







Related Discussions:- Reading from a file, Assignment Help, Ask Question on Reading from a file, Get Answer, Expert's Help, Reading from a file Discussions

Write discussion on Reading from a file
Your posts are moderated
Related Questions
I am doing project "Recognizing people in video based on their body" the system will use MATLAB to detect people based on thier body and then recognize them from their clothes "us

A fence enclosure consists of a rectangle of length L and width 2 R , and a semicircle of radius R , as shown in Figure 1. The enclosure is to be built to have an area of 1600 m

I have couple questions in MATLAB I need help in

Types: Each and every expression, or variable, has a type related with it. The MATLAB supports numerous types of values that are known as classes. A class is necessarily a com

Introduction to Matlab: The MATLAB is a graphical and mathematical software package; it has graphical, numerical and programming capabilities. It has built-in functions to do

Write a function rid_multiple_blanks that will receive a string as an input argument. The string contains a sentence that may have multiple blank spaces in between some of the word


Random numbers: Whenever a program is being written to work with a data, and the data is not yet available, it is frequently useful to test the program first by initializing t

Produce a random real number: To produce a random real number in the range from low to high, at first create the variables low and high. And then, use the expression rand*(hig

coding of sep protocol