Define condition for both imaginary and real parts of numbers

1 回表示 (過去 30 日間)
armin m
armin m 2021 年 11 月 26 日
回答済み: Adam Danz 2021 年 11 月 26 日
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 Center および File ExchangeAnimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by