Define condition for both imaginary and real parts of numbers

1 visualización (últimos 30 días)
Hi. I have a matrix. It contains numbers like a+bi. I want define a condition for numners of matrix. That say if both a and b be non zero do .... .i think iy should be like this.
if a&&b~=0
do
end BUt it does not works.tnx

Respuesta aceptada

Adam Danz
Adam Danz el 26 de Nov. de 2021
x = pi + i
x = 3.1416 + 1.0000i
if real(x)~=0 && imag(x)~=0
disp("YES")
end
YES

Más respuestas (0)

Categorías

Más información sobre Animation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by