Revision as of 13:07, 4 September 2008 by Cocker (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

MATLAB and Complex Numbers Examples

Defining terms in matlab i =sqrt(-1)

Matlab will return ans = 0 + 1i

EX.

a= 3+2i

Finding the conjugate

conj(a)

Finding the real part

real(a)

Finding the imaginary part

imag(a)

Sample Code

>> a=3+2i

a =3.0000 + 2.0000i

>> conj(a)

ans =3.0000 - 2.0000i

>> real(a)

ans =3

>> imag(a)

ans =2

Alumni Liaison

To all math majors: "Mathematics is a wonderfully rich subject."

Dr. Paul Garrett