Re: Real and complex arrays
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 25 Apr 2006 23:50:37 +0000 (UTC)
morten.langer@xxxxxxxxx wrote:
I have a problem with real and complex arrays in fortran. I have a
complex array signalComplex which contains complex numbers. I then use
abs(signalComplex) to get the magnitudes, and apparently abs() also
returns complex numbers - only with the complex part equal to 0.
Your compiler is defective. ABS should return real for complex
arguments. If you assign to a complex array, though, you will
get complex numbers with imaginary part 0.0.
I can
live with that, but is there a way to get all these magnitudes (which
are now listed as real parts of a complex array) into a real array
(i.e. "dimensioned")? Or must I work with the complex array from now
on?
PS I have tried the real(complexNumber) command, but it just returns 0,
and not the real part formatted as a real number?
REAL() should return the real part of a complex number.
Can you tell us which compiler it is?
-- glen
.
- Follow-Ups:
- Re: Real and complex arrays
- From: Rich Townsend
- Re: Real and complex arrays
- From: morten . langer
- Re: Real and complex arrays
- References:
- Real and complex arrays
- From: morten . langer
- Real and complex arrays
- Prev by Date: Re: rookie question
- Next by Date: Re: Real and complex arrays
- Previous by thread: Real and complex arrays
- Next by thread: Re: Real and complex arrays
- Index(es):
Relevant Pages
|
|