sara67
Banned
- Joined
- Dec 2, 2012
- Messages
- 32
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 0
Hi friends
I wrote a matlab code for a microstrip antenna
where i wrote Ex , Ey , Ez
i have errors
i dont know why this error occured
plz if u know , help me
my code just for this section
for ie=1:Nx;
for je=1:Ny;
for ke=1:Nz;
Ex(ie+0.5,je,ke)=cc.*Ex(ie+0.5,je,ke)+cy2.*(Hz(i+0.5,je+0.5,k)-Hz(ie+0.5,je-0.5,k))-cz2.*(Hy(ie+0.5,j,ke+0.5)-Hy(ie+0.5,j,ke-0.5))
Ey(ie,je+0.5,ke)=cc*Ey(ie,je+0.5,ke)+cz2*(Hx(ie,je,ke+0.5)-Hx(ie,je,ke-0.5))-cx2*(Hz(ie+0.5,je,ke)-Hz(ie-0.5,je,ke))
Ez(ie,je,ke+0.5)=cc*Ez(ie,je,ke+0.5)+cx2(Hy(ie+0.5,je,ke)-Hy(ie-0.5,je,ke))-cy2*(Hx(ie,je+0.5,ke)-Hx(ie,je-0.5,ke))
end
end
end
my error :
??? Attempted to access Ex(1.5,1,1); index must be a positive integer or logical.
Error in ==> FDTDlast at 82
Ex(ie+0.5,je,ke)=cc.*Ex(ie+0.5,je,ke)+cy2.*(Hz(i+0.5,je+0.5,k)-Hz(ie+0.5,je-0.5,k))-cz2.*(Hy(ie+0.5,j,ke+0.5)-Hy(ie+0.5,j,ke-0.5))
>>
I wrote a matlab code for a microstrip antenna
where i wrote Ex , Ey , Ez
i have errors
i dont know why this error occured
plz if u know , help me
my code just for this section
for ie=1:Nx;
for je=1:Ny;
for ke=1:Nz;
Ex(ie+0.5,je,ke)=cc.*Ex(ie+0.5,je,ke)+cy2.*(Hz(i+0.5,je+0.5,k)-Hz(ie+0.5,je-0.5,k))-cz2.*(Hy(ie+0.5,j,ke+0.5)-Hy(ie+0.5,j,ke-0.5))
Ey(ie,je+0.5,ke)=cc*Ey(ie,je+0.5,ke)+cz2*(Hx(ie,je,ke+0.5)-Hx(ie,je,ke-0.5))-cx2*(Hz(ie+0.5,je,ke)-Hz(ie-0.5,je,ke))
Ez(ie,je,ke+0.5)=cc*Ez(ie,je,ke+0.5)+cx2(Hy(ie+0.5,je,ke)-Hy(ie-0.5,je,ke))-cy2*(Hx(ie,je+0.5,ke)-Hx(ie,je-0.5,ke))
end
end
end
my error :
??? Attempted to access Ex(1.5,1,1); index must be a positive integer or logical.
Error in ==> FDTDlast at 82
Ex(ie+0.5,je,ke)=cc.*Ex(ie+0.5,je,ke)+cy2.*(Hz(i+0.5,je+0.5,k)-Hz(ie+0.5,je-0.5,k))-cz2.*(Hy(ie+0.5,j,ke+0.5)-Hy(ie+0.5,j,ke-0.5))
>>