Real part of complex number
X = real(Z)
example
X = real(Z) returns the real part of each element in array Z.
X
Z
collapse all
Find the real part of the complex number Z.
Z = 2+3i; X = real(Z)
X = 2
Find the real part of each element in vector Z. The real function acts on Z element-wise.
real
Z = [0.5i 1+3i -2.2]; X = real(Z)
X = 1×3 0 1.0000 -2.2000
Input array, specified as a scalar, vector, matrix, or multidimensional array. real operates element-wise when Z is nonscalar.
This function fully supports tall arrays. For more information, see Tall Arrays.
This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
This function fully supports distributed arrays. For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).
abs | complex | conj | i | imag | j
abs
complex
conj
i
imag
j
You have a modified version of this example. Do you want to open this example with your edits?