real

Returns the real part of x.

Syntax

R = real(x)

Inputs

x
Any valid scalar | vector | matrix.
Type: double | integer | logical | struct | cell
Dimension: scalar | vector | matrix

Outputs

R
Type: double
Dimension: scalar | vector | matrix

Example

Simple input:

R = real(1+2i)
R = 1