Plotting the contours of 1D dimensional data

조회 수: 14 (최근 30일)
Chandrakanth Reddy Chappidi
Chandrakanth Reddy Chappidi 2015년 10월 30일
댓글: Farnam Sadeghian 2022년 4월 12일
Hello, I have three functions f1(x,y), f2(x,y), f3(x,y). Is it possible to plot contours of f3 with f1 and f2 as axes ? ( According to the contourf, I should have f3 as 2 D matrix ).
  댓글 수: 3
Farnam Sadeghian
Farnam Sadeghian 2020년 1월 21일
I have worked in this area before. if you are interested contnact me via my site
Farnam Sadeghian
Farnam Sadeghian 2022년 4월 12일
You can find its solution here

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

답변 (1개)

Nitin Khola
Nitin Khola 2015년 11월 3일
I am assuming that f3(x,y) is a function of f1(x,y) and f2(x,y) i.e. for f3 = Fcn(f1,f2), implying there exists one value of f3 for a particular (f1,f2).
To plot contour for the data you have, you will have to use "meshgrid" to make a mesh out of f1 and f2 depending on the bounds of f1 and f2. The following documentation link contains the details: http://www.mathworks.com/help/matlab/ref/meshgrid.html
I am additionally assuming you already have a value f3 = F(f1,f2) for each (f1,f2) but it is in a vector form. You can use the "reshape" command to make a matrix of that vector. Refer to the following command for details. http://www.mathworks.com/help/matlab/ref/reshape.html
In addition, if you wish to refine the mesh, you can do so and interpolate the values of f3.

카테고리

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