Plot with a imaginary input
古いコメントを表示
Hello ! I want to plot in a 2Dgrid the magnetic and gravimetric potential of a point, in the spectral domain. However I am not very good in coding and I master only one way to do in it in the temporal domain. And this method seems not to work with a imaginary input ? Somebody can tell by what I can replace meshgrid and pcolor in my code ?
%%%Donnees et Valeurs
% p point de mesure : rho densite de la masse m ; j aimentation du dipole d ; R champ regional magnetique
X=[-50 : 0.5 : 50];
Y=[-45 : 0.5 : 55];
z=0;
[x,y] = meshgrid(X,Y);
p=[-5 2 10];
rho= 2;
G= 6.674*10^(-11);
j=[1 1 1];
R= [10 10 10];
s=sqrt(x^2+y^2);
%%Gravimetrie
% Potentiel gravimetrique
V = G*rho*2*pi*exp(i*x*p(1))*exp(i*y*p(2))*exp(-p(3)*s)./(s);
%%Plot
figure
subplot (2,2,1)
hp1 = pcolor(X,Y,V);
set(hp1,'EdgeColor','None');
colorbar
title('Potentiel gravimétrique')
回答 (1 件)
You probably just want to use
abs( V )
i.e.
hp1 = pcolor(X,Y,abs(V));
2 件のコメント
Adriane Clerc
2016 年 12 月 12 日
Steven Lord
2016 年 12 月 12 日
Can you post a link to a picture that shows the specific type of plot you hope to reproduce? That may be easier to understand that a text description of the behavior.
カテゴリ
ヘルプ センター および File Exchange で Mathematics についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!