Plotting a 3D image from a matrix for a complex domain

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
member 428835
Hi PF!

Each element of an ##n\times m## matrix is complex valued. In the following code, I call this "domain". There is also an ##n\times m## matrix that is real valued, below I call this "f". I'd like to plot a 3D image where the ##x-y## plane is the complex plain given by the coordinates "domain" who take a height f. Do you know how to do this?

Matlab:
RE_lam_end       = 30;                     
IM_lam_end       = 10;
RE_lam_start     = 0;                     
IM_lam_start     = 0;
RE_dlam          = 1;
IM_dlam          = 1;
RE_lam           = RE_lam_start:IM_dlam:RE_lam_end;
IM_lam           = IM_lam_start:RE_dlam:IM_lam_end;
domain              = RE_lam+1i*IM_lam';

f = rand(size(domain,1),size(domain,2))

I appreciate your time!
 
Physics news on Phys.org
How about making a Table to build up triplets {Re[domain[[i,j]]],Im[domain[[i,j]]],f[[i,j]]}, which you can then ListPlot3D?
 
DrClaude said:
How about making a Table to build up triplets {Re[domain[[i,j]]],Im[domain[[i,j]]],f[[i,j]]}, which you can then ListPlot3D?
Thanks for the response! I ended up using

Matlab:
surf(RE_lam,IM_lam,freq)