필터 지우기
필터 지우기

Plotting 3 variables of a single function

조회 수: 5 (최근 30일)
Kayn
Kayn 2014년 1월 28일
댓글: Giuseppe Naselli 2014년 4월 24일
Is it possible to plot three variables x,y and z of a single function f?
i.e. f = x^2 + y^2 + z^2, for example?
I'd want to plot the function 'f' with a range of values for x,y and z.
I've been looking at contour maps for two variables and would now, somehow, like to expand it to three variables and able to represent the function pictorially via a plot in Matlab.
Thanks!

답변 (2개)

AJ von Alt
AJ von Alt 2014년 1월 28일
Sliceomatic on Matlab file exchange is a useful tool for this sort of visualization.
  댓글 수: 4
AJ von Alt
AJ von Alt 2014년 1월 28일
% define an array of values for x y and z
x = -10:0.1:10;
y = -10:0.1:10;
z = -10:0.1:10;
% create a meshgrid
[Xmesh,Ymesh,Zmesh] = meshgrid(x,y,z);
% compute the function value at the meshgrid points
f = Xmesh.^2 + Ymesh.^2 + Zmesh.^2;
% launch sliceomatic
sliceomatic(f,x,y,z)
You can then select slices using the x y and z controls or view layers using the iso surface control
Giuseppe Naselli
Giuseppe Naselli 2014년 4월 24일
Hi All,
I need to do the same (plotting F as function of X,Y,Z) but I do not know the relationship between them.
Basically I have 4 column vectors F,X,Y,Z.
I can do the meshgrid(X,Y,Z) but I do not know how to manipulate F in order to use sliceomatic
Any idea?
Thanks in advance
G

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


Walter Roberson
Walter Roberson 2014년 1월 28일
For a full plot of 3 independent variables and one resultant variable, you need to encode the resultant variable as marker shape (one scatter3 or plot3 call for each different marker shape), or point size (scatter3; or a lot of plot3 calls), or as color (scatter3 or patch or a lot of plot3 calls), or as transparency (patch). (Though transparency by itself is hard to see.)

카테고리

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