필터 지우기
필터 지우기

How to I plot 3D level surfaces of this 4D function?

조회 수: 6 (최근 30일)
Jessica Peterson
Jessica Peterson 2019년 11월 13일
댓글: Walter Roberson 2019년 11월 13일
I have the following function. I wish to plot the 3D surface of the function when density equals 100000, 80000, 60000, 40000. I am unsure how to plot a function of 3 variables. Thanks
density= @(x,y,z)10.^5 -24000.*z + 10.^4.*sech((0.75.*x-1.5).^2+(y-1).^2)

답변 (1개)

Walter Roberson
Walter Roberson 2019년 11월 13일
Use ndgrid or meshgrid to create a 3D grid of x, y, z locations, and evaluate the function at those points . Suppose we call the result D .
Now use
arrayfun(@(LEVEL) isosurface(x, y, z, D, LEVEL), [100000, 80000, 60000, 40000]);
It is not possible to pass multiple levels to isosurface() in one call.
  댓글 수: 4
Jessica Peterson
Jessica Peterson 2019년 11월 13일
That creates a 2D plot of a rectangle. I am trying to make a 3D plot.
Walter Roberson
Walter Roberson 2019년 11월 13일
Grab the plot with your cursor and rotate it. Or give the command
view(3)

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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by