turn table to contour

12 views (last 30 days)
Keren Grinberg
Keren Grinberg on 9 Mar 2022
Answered: Peter Perkins on 9 Mar 2022
hello, i have teble of data:
h=[100 100 200 200 300 300 400 400]';
v=[250 260 250 260 250 260 250 260]';
T=[25 26 35 32 35 38 38 25]';
table(h,v,T)
ans =
8×3 table
h v T
___ ___ __
100 250 25
100 260 26
200 250 35
200 260 32
300 250 35
300 260 38
400 250 38
400 260 25
the valus from some experiment and i want to show them in plot. (eg - for hight of 100 m combined with 2 velocity i have to temprature 25 and 56)
i think to do contour but i dont now what i need to insert to "z" that i want to represent the temperature.
my goal is somthing like that:
when every color represent temperature -
green 25
black 38..........
  1 Comment
Benjamin Thompson
Benjamin Thompson on 9 Mar 2022
If you type "doc contour" in MATLAB you will see many ways to use it:
You probably want something like contour(h, v, T) from your table, and then use the levels parameter if you want temperature contours for specific temperature values. You should post your data to help the community provide better answers if you have more questions after trying this out.

Sign in to comment.

Answers (2)

Benjamin Thompson
Benjamin Thompson on 9 Mar 2022
If you type "doc contour" in MATLAB you will see many ways to use it:
You probably want something like contour(h, v, T) from your table, and then use the levels parameter if you want temperature contours for specific temperature values. You should post your data to help the community provide better answers if you have more questions after trying this out.

Peter Perkins
Peter Perkins on 9 Mar 2022
I'm not sure contour is the function you want to make the plot you showed. contourf, maybe? But maybe image instead.
In any case, contour does not currently accept a table as input. There are lots of reasons to put data into a table, but to call contour, you'll need contour(t.h,t.v,t.T), where t is your table.

Categories

Find more on Contour Plots 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!