Errors in the MATLAB code, Antenna Engineering Using Physical OpticsThere are errors in the MATLAB code files po09b, po13c, po15d, and po17b, most resulting from calls to previous versions of 3 m-file functions:
incorrect name-----------------correct name
unitr-------------------------norm01
crossr------------------------cross01
vlenr-------------------------length01
These errors can be corrected by making the following changes:
1. on m-file po09b, listed in pages 147-148 of the text, 4 lines must be changed:
line 22 is:
ut2=ones(Na,1)*unitr(crossr(un0,[1 0 0]));
but should be:
ut2=ones(Na,1)*norm01(cross01(un0,[1 0 0]));
line 24 is:
ut1=crossr(ut2,un0);
but should be:
ut1=cross01(ut2,un0);
line 49 is:
urs=unitr([rs zeros(Na,1)]);
but should be:
urs=norm01([rs-ones(size(DSa))*r0]);
line 50 is:
ups=crossr(uns,urs);
but should be:
ups=cross01(uns,urs);
2. on m-file po13c, listed in pages 202-203 of the text, 3 lines must be changed:
line 59 is:
alr=atan(2*Fl./vlenr(rr));
but should be:
alr=atan(2*Fl./length01(rr-rr(:,3)*[0 0 1]));
line 62 is:
u2r=unitr(crossr(unr,ones(Nr,1)*[1 0 0]));
but should be:
u2r=norm01(cross01(unr,ones(Nr,1)*[1 0 0]));
line 63 is:
u1r=crossr(u2r,unr);
but should be:
u1r=cross01(u2r,unr);
3. on m-file po15d, listed on pages 222-224 of the text, 1 line must be changed:
line 26 is:
u2bf=unitr(cross01(unbf,[1 0 0]));
but should be:
u2bf=norm01(cross01(unbf,[1 0 0]));
4. on m-file po15e, listed on pages 222-224 of the text, 1 line must be changed:
line 18 is:
EscJ=-Z0*cross01(ut(nb,:),HscJ); % source E field
HscM=1/Z0*cross01(ut(nb,:),EscM); % source E field
but should be:
EscJ=-Z0*cross01(unb(nb,:),HscJ); % source E field
HscM=1/Z0*cross01(unb(nb,:),EscM); % source E field
5. on m-file po17b, listed on pages 254-257 of the text, 2 lines must be changed:
line 24 is:
u2c1=unitr(cross01(unc1,[1 0 0]));
but should be:
u2c1=norm01(cross01(unc1,[1 0 0]));
line 64 is:
u2c2=unitr(cross01(unc2,[1 0 0]));
but should be:
u2c2=norm01(cross01(unc2,[1 0 0]));