Define condition for both imaginary and real parts of numbers

1 次查看(过去 30 天)
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

采纳的回答

Adam Danz
Adam Danz 2021-11-26
x = pi + i
x = 3.1416 + 1.0000i
if real(x)~=0 && imag(x)~=0
disp("YES")
end
YES

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Animation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by