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

Click For Summary
SUMMARY

The discussion focuses on plotting a 3D image from a complex-valued matrix using MATLAB. The user aims to visualize a complex plane defined by an n×m matrix called "domain" and a corresponding real-valued matrix "f". The solution provided involves using the MATLAB function surf to create the 3D surface plot, specifically with the command surf(RE_lam, IM_lam, freq). This approach effectively represents the relationship between the real and imaginary components of the complex domain and the height defined by the matrix "f".

PREREQUISITES
  • Understanding of complex numbers and their representation in matrices.
  • Familiarity with MATLAB programming and its plotting functions.
  • Knowledge of 3D surface plotting techniques in MATLAB.
  • Basic concepts of matrix manipulation in MATLAB.
NEXT STEPS
  • Explore MATLAB's meshgrid function for creating coordinate grids.
  • Learn about MATLAB's ListPlot3D for alternative 3D plotting methods.
  • Investigate advanced surface plotting options in MATLAB, such as surf and mesh.
  • Study the implications of complex-valued functions in data visualization.
USEFUL FOR

Data scientists, MATLAB users, and engineers interested in visualizing complex-valued data in 3D plots.

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)
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K