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 个)

Adam
Adam 2016-12-12
编辑:Adam 2016-12-12
You probably just want to use
abs( V )
i.e.
hp1 = pcolor(X,Y,abs(V));

2 个评论

No, it does not work (the given plot is not correct), I really need a tool to plot an imaginary fonction... I have to change "pcolor" but i don't know which one use instead .
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!

Translated by