How can I plot the defined objects in Matlab?

Status
Not open for further replies.

project.email

Member level 4
Joined
May 25, 2007
Messages
77
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,288
Activity points
1,845
Dear friends
I'm trying to execute the FDTD code of this book:
"The Finite Difference Time Domain Method for Electromagnetics With MATLAB Simulations"
In the chapter 3 I want to the see the objects defined by the define_geometry.m and show something like the following Figure.



Code:
disp('defining the problem geometry');

bricks  = [];
spheres = [];

% define a brick with material type 4
bricks(1).min_x = 0;
bricks(1).min_y = 0;
bricks(1).min_z = 0;
bricks(1).max_x = 24e-3;
bricks(1).max_y = 20e-3;
bricks(1).max_z = 11e-3;
bricks(1).material_type = 4; 

% define a brick with material type 2 
bricks(2).min_x = -20e-3;
bricks(2).min_y = -20e-3;
bricks(2).min_z = -11e-3;
bricks(2).max_x = 0;
bricks(2).max_y = 0;
bricks(2).max_z = 0;
bricks(2).material_type = 2; 

% define a sphere with material type 5 
spheres(1).radius   = 20e-3;
spheres(1).center_x = 0;
spheres(1).center_y = 0;
spheres(1).center_z = 40e-3;
spheres(1).material_type = 5; 

% define a sphere with material type 1 
spheres(2).radius   = 15e-3;
spheres(2).center_x = 0;
spheres(2).center_y = 0;
spheres(2).center_z = 40e-3;
spheres(2).material_type = 1;
but I really can't do it?!
I attached the whole files of the chapter 3 can anybody help me, please?
Regards.
 

Attachments

  • Chapter_3.rar
    16.1 KB · Views: 161

Hi friend;
when you run "fdtd_solve.m" you don't have the necessary figures. Then go to "display_problem_space.m" line 4 and make
Code:
show_problem_space = true
Then run again the "fdtd_solve.m". You will see the necessary figure.
Check the code "display_problem_space.m" from line 64 to 109 and "display_3D_geometry.m" from line 114.
Those can help to understand how to display those figures.

Hope helps
Good luck
 
u need all files of all chapters because all are linked together...then only it will work bro...
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…