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
Walter Roberson
2013년 3월 15일
How do you want to represent your "t" ? As dot size? As color? Ignore the z and treat "t" as if it were z ?
rama krishna
2013년 3월 15일
Walter Roberson
2013년 3월 15일
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.
Walter Roberson
2013년 3월 15일
How do you know which points are adjacent?
rama krishna
2013년 3월 15일
답변 (2개)
Youssef Khmou
2013년 3월 15일
hi,
try
plot3(x,y,t);
scatter3(x,y,t,'r');
% z is constant !
Youssef Khmou
2013년 3월 16일
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......
카테고리
도움말 센터 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!