필터 지우기
필터 지우기

How to make a 1D become 2D and create a contourf plot

조회 수: 12 (최근 30일)
Kafayat Olayinka
Kafayat Olayinka 2020년 2월 11일
댓글: Kafayat Olayinka 2020년 2월 14일
Let say:
time=[1:10];
height=[100:100:1000];
temp=[273:1:282];
So as, i can plot(time,temp)
and i can also plot(temp,height)
How can I make newTemp(time,height) so that I can make a contourf plot such that
v-[1:1:100]
contourf(time,height,newTemp,v)
  댓글 수: 2
KSSV
KSSV 2020년 2월 12일
Do you have any equations for that? What is the dependency?
Kafayat Olayinka
Kafayat Olayinka 2020년 2월 12일
There is no equation to this problem. I want Temp(time,height) for my contourf plot.

댓글을 달려면 로그인하십시오.

채택된 답변

Ajay Pattassery
Ajay Pattassery 2020년 2월 14일
You could use meshgrid which returns the 2-D grid coordinates contained in the vectors time and height.
[timeX,heightY] = meshgrid(time, height);
Then You can define newTemp for all the values of [timeX,heightY] and use contourf.
v-[1:1:100]
contourf(timeX,heightY,newTemp,v);
Refer here for more information about meshgrid.
Refer the section Contours at Ten Levels in following example for usage of contourf.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by