Load from file and plot data, MATLAB Programming

Example: Load from File and Plot Data:

As illustration, a file known as timetemp.dat stores two lines of data. The first line is the time of the day, and the next line is the recorded temperature at each of those times. The first value of 0 for the time presents midnight. For illustration, the contents of the file may be:

0  3  6  9 12 15 18 21

55.5 52.4 52.6 55.7 75.6 77.7 70.3 66.6

The script below loads the data from the file into a matrix known as the timetemp. It then separates the matrix into vectors for the time & temperature, and then plots the data by using black + symbols.

1476_Load from File and Plot Data.png

Running the script generates the plot seen in figure:

 

1645_Load from File and Plot Data1.png

Note that it is difficult to see the point at time 0 as it falls on the y-axis. The axis function can be used to change the axes from the defaults as shown 

Posted Date: 10/18/2012 7:11:37 AM | Location : United States







Related Discussions:- Load from file and plot data, Assignment Help, Ask Question on Load from file and plot data, Get Answer, Expert's Help, Load from file and plot data Discussions

Write discussion on Load from file and plot data
Your posts are moderated
Related Questions
hey ! why the command sawtooth and square does not exist in Matlab R2012a?


Linspace function: Likewise, the linspace function generates a linearly spaced vector; linspace(x,y,n) generates a vector with n values in the inclusive range from x to y. For

Write a MATLAB program that calculates the arithmetic mean, the geometric mean, and the root-mean-square average for a given set of values. Your program must use 3 functions t

write a computer program that will provide a user with the equilibrium concentration of vacancies in a metallic element as a function of temperature.Temperature range should be men

Creating Column Vectors: One way to generate a column vector is by explicitly putting the values in square brackets, separated by the semicolons: >> c = [1; 2; 3; 4] c =

Model the three degree of freedom system shown in Figure Q5 and solve for the displacements of the three masses due to a force of 10 N applied to the bottom mass at a frequency of

How to make EMG analysis by Matlab?

i want matlab programming on johnson''s sequencing rule

whats thye procedure for entering say an LP model, maximisation an objective funtion ''10x+3y'' subject to: 40 300x +298y>=299 x+y=1