3-D figure

21 ビュー (過去 30 日間)
Sarah Saeed
Sarah Saeed 2023 年 7 月 7 日
移動済み: Cris LaPierre 2023 年 7 月 7 日
Can you please help me with plotting a 3D figure that shows the cones representing the field of view of multiple elements that have different elevation and azimuth angles, similar to the figure below.
Thank you
  2 件のコメント
Dyuman Joshi
Dyuman Joshi 2023 年 7 月 7 日
There are 2 cones in the plot figure and 3 cones in the image at top right.
Which one do you want to obtain?
Sarah Saeed
Sarah Saeed 2023 年 7 月 7 日
編集済み: Sarah Saeed 2023 年 7 月 7 日
Thank you for the reply.
Both, since I need to plot different figures with different number of cones and I was wondering if they can be superimposed on each other.
Also since the FOVs overlap, how this can be shown?

サインインしてコメントする。

採用された回答

Cris LaPierre
Cris LaPierre 2023 年 7 月 7 日
Sure. Here's an eample of a cone along the Z axis. Use the 'FaceAlpha' name-value pair to adjust transparency:
I've made some adjustments below. This is a 'brute force' approach.
r = linspace(0,3,20) ;
th = linspace(0,2*pi,20) ;
[R,T] = meshgrid(r,th) ;
X = R.*cos(T) ;
Y = R.*sin(T) ;
Z = R ;
mesh(X,Y,Z,"EdgeColor",'k',"FaceAlpha",0.5)
axis equal
A better alternative might be what is discussed in this answer:
Here, you can at lease take advantage of the hgtransform function to position your cone.
figure
r = linspace(0,3,20) ;
[X,Y,Z]=cylinder(r);
% cone 1:
M=makehgtform('translate',[0,0,0],'yrotate',120*pi/180,'zrotate',15*pi/180);
h=mesh(X,Y,Z,'Parent',hgtransform('Matrix',M),"EdgeColor",'k','FaceAlpha',0.5);
hold on
% cone 2
M2=makehgtform('translate',[0,0,0],'xrotate',pi/2,'zrotate',240*pi/180);
h2=mesh(X,Y,Z,'Parent',hgtransform('Matrix',M2),"EdgeColor",'k','FaceAlpha',0.5);
hold off
xlabel('X')
ylabel('Y')
axis equal
view([-127.5 30])
  1 件のコメント
Sarah Saeed
Sarah Saeed 2023 年 7 月 7 日
移動済み: Cris LaPierre 2023 年 7 月 7 日
@Cris LaPierre, thank you so much, this is really helpful.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by