Plotting temperature contours from txt file
3 views (last 30 days)
Show older comments
Hello to everyone,
I am new here and I am new at all.
I have a set of data in txt file. For example something like this:
x y z
30 50 5
32 48 6
28 45 10
22 49 8
The points are scattered because are collected from some weather stations in different places. x is longitude and y latitude and z temperature.
1.I would like to know if there is any way to read the data from this txt file and to plot contours using an interpolation method (for example IDW).
2.At the same time I would like to plot the corresponding coastline on the background.
Thanks on account,
please for more clarifications just ask me.
2 Comments
Answers (1)
Jonathan LeSage
on 16 Oct 2013
To help you get started, I found some examples in the documentation about interpolation of data using the scatteredInterpolant function. You can find the links below. In the first link, check out the section entitled, "2-D Interpolation." In the second link, you can find additional examples and other methods for what you're trying to do.
- http://www.mathworks.com/help/matlab/ref/scatteredinterpolantclass.html
- http://www.mathworks.com/help/matlab/math/interpolating-scattered-data.html
Also, you might want to pay attention to the selected extrapolation method. More information can be found in the documentation for scatteredInterpolant.
As far as the importing of your data, I would use the tdfread function. To find out more:
doc tdfread
Good luck!
4 Comments
See Also
Categories
Find more on Weather and Atmospheric Science in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!