Plotting file data, MATLAB in Engineering

Plotting File data:

It is frequently essential to read data from a file and plot it. Generally, this entails knowing the format of the file. For illustration, let us suppose that a company has two divisions, called A &B. The file 'ab06.dat' has 4 lines in it (we will suppose this), with the sales figures in millions for the two divisions for each quarter of the year 2006. For illustration, the file may appear like this (the format will be precisely like this):

A5.2B6.4

A3.2B5.5

A4.4B4.3

A4.5B2.2

 

The script below reads the data and plots in one Figure Window the data as the bar charts. The script prints an error message when the file open is not successful or when the file close was unsuccessful. The axis command is used to force the x-axis to range from 0 to 3 and the y-axis from 0 to 8 that will result in the axes shown here. The numbers 1 and 2 would display on the x-axis instead of the division labels A and B by default. The set function modifies the XTickLabel property to use the strings in the cell array as labels on the tick marks on the

x-axis; and gca returns the handle to the axes in the present figure (it stands for "get present axes").

609_Plotting File data.png

Running this generates the subplot as shown in figure.

1154_Plotting File data1.png

Posted Date: 10/22/2012 2:23:20 AM | Location : United States







Related Discussions:- Plotting file data, Assignment Help, Ask Question on Plotting file data, Get Answer, Expert's Help, Plotting file data Discussions

Write discussion on Plotting file data
Your posts are moderated
Related Questions
Sound Files: The sound signal is an illustration of a continuous signal which is sampled to result in a discrete signal. In this situation, sound waves traveling through the a

Function used in binary search: The function below implements this binary search algorithm. It receives two arguments: the sorted vector and a key (on the other hand, the func

Evaluating a string: The function eval is used to compute a string as a function. For illustration, below is the string 'plot(x)'is interpreted to be a call to plot the functi

Technique to creating this structure: An alternative technique of creating this structure, that is not as efficient, includes using the dot operator to refer to fields in the

Appending variables to the Mat-File: Appending to the file adds to what has been saved in a file, and is accomplished by using the -append option. For illustration, supposing

Inverse of square matrix: The inverse is, hence the result of multiplying the scalar 1/D by each and every element in the preceding matrix. Note that this is not the matrix A,

FOR Loop: The for loop, or the for statement, is used whenever it is essential to repeat statement(s) in the script or function, and whenever it is known ahead of time how man

Function used in sound files: The MATLAB has numerous other functions which let you read and play sound or audio files. In the audio files, sampled data for each audio channel

For Loops which do not use an iterator Variable in the action: In all the illustrations that we seen so far, the value of the loop variable has been used in same way in the ac

i want to run 4 instances of my matlab code on 4 processor cores. im executing the job from head node. i created a parallel job and assigned number of workers. but i don''t get bac