how to make a 3d plot with x,y,z, coordinates and data (t)

Hi, I have x,y,z,t data in a excel file. The x,y,z are coordinates while t is data. How can i plot a 3d plot. the x,y,z are usually in a plane so z is constant. x and y are equispaced and sometimes may not be. how to plot. expecting earliest attention thanks rama

5 Comments

How do you want to represent your "t" ? As dot size? As color? Ignore the z and treat "t" as if it were z ?
i want to represent t as colour as a surface or a mesh. I can ignore z but i want it to be there. is there any function that can handle it without using meshgrid.
To get a surface or mesh you need to know something about the connectivity of the points.
Consider for example a simple list of 5 points around a circle: connect them in clockwise order and you get a pentagon shape, but connect each to the second closest instead and you get a "star" (pentagram). Likewise if you do not know which of your points connect to which, you cannot know how to build your surface.
How do you know which points are adjacent?
if u know a bit of programming u can tell. btw who r u who waste time of others

Sign in to comment.

Answers (2)

hi,
try
plot3(x,y,t);
scatter3(x,y,t,'r');
% z is constant !
hi ,
as you want to visualize t ( t as function of x and y t=F(x,y)) then i suggest this trick , i show it based on an example ok? :
1)EXAMPLE 1 :
x=0:0.1:10;
y=0:0.1:10;
t=randn(size(x));
% I ADJUST the lengths so as to map the vectors x and y into matrices
X=reshape(x(1:100),10,10);
Y=reshape(y(1:100),10,10);
T=reshape(t(1:100),10,10);
% FIGURE
surf(X,Y,T);shading interp
2)EXAMPLE2 :
x=randn(10); % Gaussian Process N(0,1)
y=randn(10); % same ~N(0,1)
t=rand(10); % Random Uniform distribution
surf(x,y,t);shading interp
i hope this helps , try to apply on your data and see......

Asked:

on 15 Mar 2013

Community Treasure Hunt

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

Start Hunting!