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
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

추가 답변 (0개)


Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by