Ask help for understanding of this Matlab code

Status
Not open for further replies.

yzou_ua

Member level 5
Joined
Nov 5, 2008
Messages
92
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,869
understanding matlab code

This is the EXAMPLE 1.15 in "Fundamentals of Electromagnetics with MATLAB" (by Karl E. Lonngren, 2007):

To plot the vector field A = exp(-(ro/alpha)²)uro
where ro is one of cylindrical coordinates (ro, phi, z) and ruo denotes the unit vector of ro. alpha is cnst.

The attached is code for plot this vector field and its divergence.

I cannot understand what does it mean by following:
Ax(k,s)=exp(-r2(k,s)/alpha.^2)*x(k,s);
Ay(k,s)=exp(-r2(k,s)/alpha.^2)*y(k,s);

Where do they come from??
 

codes for cylindrical coordinates in matlab

Thx. I will have a try...

It seems that these 2-lines code intend to convert the cylindrical coordinates to cartsian coord. and then carry on the derivative on x and y components, respectively.
I'm not sure yet...

VSWR said:
Why not email the author and ask:

karl-lonngren(at)uiowa.edu

(The University of Iowa)
 

Hi "yzou_ua"

can you please email me the .m files for 'fundamentals of electromagnetics with matlab' ???

i need it in urgent.

I will be remain thankful to you
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…