3D plot
이전 댓글 표시
Antenna_X_Pos=[-0.0012;0.1419;-0.0672;-0.1121;0.1173;0.0653;-0.1458;0];
Antenna_Y_Pos=[0.1495;-0.0374;-0.1328;0.0896;0.0880;-0.1347;-0.0340;0];
Antenna_Z_Pos=[0.1269;0.0798;0.0428;0.0002;-0.0407;-0.0816;-0.1249;0];
%scatter3(Antenna_X_Pos,Antenna_Y_Pos,Antenna_Z_Pos),view(-90,90)
%grid on
for j=1:360
theta(j)= j / 180 *pi; % [Edited, Jan Simon: inlined "degtorad()"]
for m=1:90
sita(m)= m / 180 *pi;
[SP_X(j,m) SP_Y(j,m) SP_Z(j,m)] = sph2cart(theta(j),sita(m),10);
for i=1:numel(Antenna_X_Pos)
Distance(i,j,m) = sqrt(((Antenna_X_Pos(i) - SP_X(j,m))^2 +(Antenna_Y_Pos(i) - SP_Y(j,m))^2+(Antenna_Z_Pos(i) - SP_Z(j,m))^2));
end
end
end
Distance
How can I plot Distance in 3D (using i,j,m) ?
댓글 수: 9
Jan
2011년 12월 19일
We cannot run your code. degtorad and Antenna_X_Pos etc are not known.
what kind of 3D visualization do you want?
zozo
2011년 12월 19일
Jan
2011년 12월 19일
The output "Distance" is a [8 x 360 x 90] array. How do you want to visualize this? As surface, as 3D-polar-plot, as set of 8 discs with different colors?
zozo
2011년 12월 19일
zozo
2011년 12월 19일
Jan
2011년 12월 19일
Dear zozo, the variable "Distance" is not a vector, but a [8 x 360 x 90] array. It is not trivial to plot it and I will not post examples for all possibilities - there are too many.
Please take the time to find out, how you want to display these data. You can draw a picture by hand and post it.
zozo
2011년 12월 20일
Walter Roberson
2011년 12월 20일
You cannot surface plot an 8 x 360 x 90 array. The closest you can come is to use isosurface()
zozo
2011년 12월 20일
답변 (1개)
James Ryland
2017년 5월 11일
0 개 추천
If you store your distance data as 3D array 8 x 360 x 90 you have several ways to visualize what it looks like.
Both of these solutions turn 3D scaler fields into voxels with color and transparency, thus allowing you to visualize 3D density or distance fields.
Solution 1: Volumetric 3 is a full matlab application for visualizing layered 3D density matrices. It was designed to work with fmri and mri but it can handle arbitrary 3D arrays stored as .mat files.
https://www.mathworks.com/matlabcentral/fileexchange/59161-volumetric-3?s_tid=srchtitle
Solution 2: A much simpler tool is Vol3D. But with a lot of programming on your end you can get it to do pretty much anything volumetric 3 does, in that they use highly similar (though distinct) techniques for generating visualizations.
카테고리
도움말 센터 및 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!