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
how to code this function

khdjkafhoi woiruwoi epojrpeo

The characteristic properties of an aquifer can be used to calculate groundwater velocities, v groundwater (L/T), according to: where KH (L/T) is the hydraulic conductivit

Plot way forms for the following modulation schemes using Mathlab: a)      2 ASK                     b)  BFSK                        c) BPSK 4 ASK

Illustrations of calling the function: Here are illustrations of calling the function: >> cylcost(32,73,4.50) ans = 661.5000 >> fprintf('The cost would be $%.2f\n'

Various commands for get the help: There are various commands which can serve as an introduction to MATLAB and allow you to get the help: info will show contact informatio

Create a text file with simulated data. Calculate an experimental y using the first function and some reasonable values for the parameters Add noise Save the x values and ca

Temperature readings were done every hour (starting at 1 P.M., but the end time could vary) and stored in a vector called readings. Write a function called halffit that receives th


how to model a diode in matlab given data