Complex number determination

42 vues (au cours des 30 derniers jours)
iael
iael le 3 Jan 2012
How can I check if a number is imaginary? I want to set an if function, that if a variable is an aimginary number then something will happen.

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 3 Jan 2012
z - your number
out = imag(z) ~= 0;
if out = true, then z - complex number
OR
out = isreal(z)
if out = false, then z - complex number

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by