How can I separate complex numbers from the other in a matrix?

3 ビュー (過去 30 日間)
masoud jiryaei
masoud jiryaei 2019 年 5 月 10 日
コメント済み: the cyclist 2019 年 6 月 18 日
Hello
I have a matrix that includes: complex numbers , natural numbers and ...
I want to separate the complex numbers from the other
How can I do this ?
Is there any order in MATLAB ?

採用された回答

the cyclist
the cyclist 2019 年 5 月 10 日
編集済み: the cyclist 2019 年 5 月 10 日
% Example data
z = [1 1+2*i 3 4+5*i]
mask = imag(z)==0;
The variable mask is a logical variable that is TRUE at the locations of the numbers that do not have an imaginary component, and FALSE otherwise.
You'll need to be careful if you have imaginary parts that are within floating-point precision of zero. You might need to use a tolerance, rather than strict equality.
  6 件のコメント
masoud jiryaei
masoud jiryaei 2019 年 6 月 18 日
Hello,
How can i send a three-dimensional matrix to the Excel?
the cyclist
the cyclist 2019 年 6 月 18 日
Rather than ask in three different places (two questions, and this comment) within one hour, I suggest you be a little patient and see what answers you get on one question. You already have some suggestions in your questions here and here.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by