Contour Plot in Matlab: DATA COLLECTED vs TIME in date and hours

In summary: Bar Charts)In summary, the conversation discusses a request to create a contour plot in MATLAB with data and time values. The person asking for help is new to MATLAB and is unsure of how to convert the date and hour information into a time series vector. The conversation also includes information on how to import data into MATLAB and resources for learning more about plotting in MATLAB, specifically 2D and contour plots. The possibility of creating a bar chart is also mentioned.
  • #1
ralm1204
1
0
Hello, All. Thank you in advance for any help, contribution and your time. I have been asked to do a contour plot with a data vs time (date and hours), I am new with Matlab and I don't really know how to make this date and hour in a time series vector to do my contour plot. I have added the data and time for the plot, each time correspond to each data.

DATA & TIME: 09/23/2008 06:37:00 09/23/2008 06:46:00 09/23/2008 06:52:00 09/23/2008 07:00:00 09/23/2008 07:03:00 09/23/2008 07:10:00 09/23/2008 07:15:00 09/23/2008 07:15:00 09/23/2008 07:15:00 09/23/2008 07:22:00 09/23/2008 07:26:00 09/23/2008 07:30:00 09/23/2008 07:44:00 09/23/2008 07:48:00 09/23/2008 07:52:00 09/23/2008 07:52:00 09/23/2008 08:00:00 09/23/2008 08:07:00 09/23/2008 08:26:00 09/23/2008 08:26:00 09/23/2008 08:26:00 09/23/2008 08:26:00 09/23/2008 08:36:00 09/23/2008 08:45:00 09/23/2008 08:45:00 09/23/2008 09:03:00 09/23/2008 09:07:00 09/23/2008 09:10:00 09/23/2008 09:12:00 09/23/2008 09:45:00 09/23/2008 09:53:00 09/23/2008 09:56:00 09/23/2008 09:59:00 09/23/2008 10:15:00 09/23/2008 10:19:00 09/23/2008 10:23:00 09/23/2008 10:26:00 09/23/2008 10:46:00 09/23/2008 10:51:00 09/23/2008 11:03:00 09/23/2008 11:09:00 09/23/2008 11:30:00

DATA COLLECTED: 77.17391304 81.73076923 68.53002070 78.24609109 72.50000000 78.93617021 78.71602082 78.99437774 76.33373319 72.82282282 70.03222342 78.52906287 73.14662273 62.69315673 67.33668342 67.33668342 62.53902185 73.21178121 78.53315149 81.32196315 81.86759896 80.43368633 77.51329332 76.89075630 74.82312034 80.64516129 63.14136126 75.27512839 99.95674201 74.91749175 66.70201485 72.31578947 74.24857839 76.74008811 80.06872852 75.18910741 81.28031038 78.17543860 77.52403846 78.49017580 79.54122753 71.64461248
 
Physics news on Phys.org
  • #2
Welcome to PhysicsForums!

We can't do your (home)work for you, but we can help you along a little. If you're absolutely brand new, I suggest making use of the Mathworks' MATLAB tutorial, or their getting started with MATLAB series:
http://www.mathworks.com/academia/student_center/tutorials/launchpad.html (Tutorials)
http://www.mathworks.com/help/techdoc/learn_matlab/bqr_2pl.html (Getting Started)

If you have these in an ASCII text file (tip: copy and paste into Notepad / another text editor, with or without the column heading, save, and then use the MATLAB data import GUI), you can easily import them into MATLAB:
http://www.mathworks.com/help/techdoc/import_export/f5-35378.html

Since you only have 'data' and 'time / date', I don't really think you can make a contour chart (usually implies you have two variables, along with some data). Nevertheless, you can read more on plotting at the Mathworks:
http://www.mathworks.com/help/techdoc/ref/plot.html (2D Plotting)
http://www.mathworks.com/help/techdoc/creating_plots/f10-2524.html (Contour Plotting)

EDIT: If you want a bar chart, you can also make that in MATLAB. For the basics of that:
http://www.mathworks.com/help/techdoc/creating_plots/f10-19972.html
 
Last edited by a moderator:

Related to Contour Plot in Matlab: DATA COLLECTED vs TIME in date and hours

1. What is a contour plot in Matlab?

A contour plot is a graphical representation of a 3-dimensional surface in 2 dimensions. It is created by plotting the level curves or contours of a function or dataset. In Matlab, it is commonly used to display the relationship between two variables, such as data collected over time.

2. How do I create a contour plot in Matlab?

To create a contour plot in Matlab, you can use the "contour" function. This function takes two vectors as input, one for the x-axis and one for the y-axis, and a matrix of data values. It then plots the contours of the data points on a 2-dimensional grid. You can also use the "contourf" function to create a filled contour plot with colored regions.

3. What is the difference between a contour plot and a surface plot in Matlab?

A contour plot shows the relationship between two variables by displaying the contours of a 3-dimensional surface on a 2-dimensional plane. A surface plot, on the other hand, displays the actual 3-dimensional surface. Contour plots are useful for visualizing the overall trend of the data, while surface plots provide a more detailed view of the data.

4. Can I customize the appearance of a contour plot in Matlab?

Yes, you can customize the appearance of a contour plot in Matlab. You can change the color scheme, add labels and titles, adjust the contour levels, and more. You can also use the "contourcmap" function to create a custom color map for your contour plot.

5. How can I add a time dimension to a contour plot in Matlab?

To add a time dimension to a contour plot in Matlab, you can use the "datetick" function. This function allows you to format the x-axis as dates and times. You can also use the "datetime" function to convert your date and time data into a datetime format, which can then be used for plotting.

Similar threads

Replies
1
Views
938
Replies
2
Views
1K
Replies
2
Views
1K
  • Programming and Computer Science
Replies
8
Views
3K
  • Programming and Computer Science
Replies
2
Views
2K
Replies
58
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
2K
  • Programming and Computer Science
Replies
4
Views
3K
  • Science and Math Textbooks
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
Back
Top