e^(i*pi) is the natural way of calculating vectors in complex
plane. It failed for me, though, and I realized that I used the
variable 'i' as a loop index, overwriting its original value of an
imaginary unit vector, which octave assigns on startup to i,I, j,J.
octave:1> i,j,I,J
i = 0 + 1i
j = 0 + 1i
I = 0 + 1i
J = 0 + 1i
All of those variables can be overwritten:
octave:2> i=j=I=J=1;i,j,I,J
i = 1
j = 1
I = 1
J = 1
so the safe way to use them is to use 1i etc.
octave:3> 1i,1j,1I,1J
ans = 0 + 1i
ans = 0 + 1i
ans = 0 + 1i
ans = 0 + 1i
Perhaps the use of predefined 'i' should elicit a warning?
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave