plotting a volume data in x and y plane
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
how can i plot the volume data in just the x and y plane.

採用された回答
darova
2019 年 9 月 21 日
Use volumeslice() or contourslice()
11 件のコメント
Anandu S
2019 年 9 月 21 日
the function is in spherical co-ordinates, so how to use slice?
Anandu S
2019 年 9 月 21 日
[x,y,z] = sph2cart(theta1,phi1,r1);
zslice=0;
slice(x,y,z,sinr,[],[],zslice);
To use slice we require the cartesian coordinates and that's where everythng goes wrong.
darova
2019 年 9 月 21 日
Why it goes wrong? You have converted your variables to cartesian
Looks ok for me. Show the whole script
Anandu S
2019 年 9 月 22 日
clc;
clear all;
close all;
Am=30;
isd=750;
h=50;
n=3;
R=isd./(2*cosd(30));
ps=((3*sqrt(3)*(R^2))/2)^(-1);
PdB=44;
P=10.^((PdB-30)./10);
K=1;
G0=10^(26/10);
theta3dB=40.*(pi/180);
phi3dB=10.*(pi/180);
phi_tilt=-20.*(pi/180);
theta1=-180:180;
theta1=theta1.*(pi/180);
phi1=-90:90;
phi1=phi1.*(pi/180);
r1=0:350;
[theta phi r]=meshgrid(theta1,phi1,r1);
[u v w]=size(theta);
Nth=randn(u,v,w);
AhdB=-min(12.*(theta./theta3dB).^2,Am);
AvdB=-min(12.*((phi-phi_tilt)./phi3dB).^2,Am);
AdB=-min(-(AhdB+AvdB),Am);
GvdB=-min(12.*((phi_tilt)./phi3dB).^2,Am);
BdB=-min(min(12.*(theta./theta3dB).^2,Am),Am+GvdB);
B=10.^(BdB./10);
Gv=10.^(GvdB./10);
B_1=trapz(theta1,B,2);
B_2=B_1(1,1,1);
Ah1dB=-min(12.*(theta+(2*pi/3)./theta3dB).^2,Am);
Ah2dB=-min(12.*(theta-(2*pi/3)./theta3dB).^2,Am);
A1dB=-min(-(Ah1dB+AvdB),Am);
A2dB=-min(-(Ah2dB+AvdB),Am);
A=10.^(AdB./10);
A1=10.^(A1dB./10);
A2=10.^(A2dB./10);
s1=(3.*Gv.*ps.*((isd-r).^(2-n)).*B_2)./((n-2).*((r.^2+h.^2).^(-n./2)).*A);
s2=(A1+A2)./A;
s3=Nth./(G0.*P.*K.*((r.^2+h.^2).^(-n./2)).*A);
inv_sinr=s1+s2+s3;
sinr=1./(inv_sinr);
[x,y,z] = sph2cart(theta,phi,r);
zslice=0;
slice(x,y,z,sinr,[],[],zslice);
Error using interp3 (line 150)
Input grid is not a valid MESHGRID.
Error in slice (line 103)
vi = interp3(x,y,z,v,xi,yi,zi,method);
Error in analytic (line 70)
slice(x,y,z,sinr,[],[],zslice);
I get this error when I run it.
darova
2019 年 9 月 22 日
Ok i understood. So maybe another way:
- create plane in spherical system coordinates
- make slice in spherical
- convert data to cartesian
See attached script
Anandu S
2019 年 9 月 23 日
Can you please get me a final script for my particular case?
darova
2019 年 9 月 23 日
Just replaced top part with yours (i also reduced number of mesh point, too much of them)
Anandu S
2019 年 9 月 23 日
The output is not correct, might be because of sumthing did.Thanks for the help mate, the plotting part of the script is correct I guess.
darova
2019 年 9 月 23 日
Do you have source formulas for your code? Where are those come from?
Anandu S
2019 年 9 月 24 日
the formula i used can be found in https://ieeexplore.ieee.org/document/7492925/authors#authors
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Surface and Mesh Plots についてさらに検索
参考
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)

