realdata

Determine whether iddata is based on real-valued signals

Syntax

realdata(data)

Description

realdata returns 1 if

  • data contains only real-valued signals.

  • data contains frequency-domain signals, obtained by Fourier transformation of real-valued signals.

Otherwise realdata returns 0.

Examples

collapse all

Load data.

load iddata1

Transform the data to frequency domain.

zf = fft(z1);

Determine if the time-domain data values are real.

isreal(z1)
ans = 1

Determine if the transformed data values are real.

isreal(zf)
ans = 0

Determine if the data is based on real-valued signals.

realdata(zf)
ans = logical
   1

Add negative frequencies to zf and rerun the command.

zf = complex(zf);
realdata(zf)
ans = logical
   1

The command still returns 1.

Introduced before R2006a