Complex number determination
44 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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.
0 Commenti
Risposta accettata
Andrei Bobrov
il 3 Gen 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
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!