yzou_ua
Member level 5
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??
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??