can you remove complex values from a plot

I am using plotyy but I have noticed that it begins to try and plot complex values. I know the data is accurate up until the numbers become complex. Is there a way to tell matlab to not plot the complex values.
Edit
I am plotting 2 [3x99] matrices. In one matrix the values will become complex after a point while the other matrix will always be real. I am looking for a way to ignore the complex values.

 採用された回答

Sean de Wolski
Sean de Wolski 2014 年 10 月 24 日
編集済み: Sean de Wolski 2014 年 10 月 24 日

1 投票

xreal = real(x)
More
x = [3+0i,5+1i,4+2i,1+0i]
x(~imag(x))

3 件のコメント

G
G 2014 年 10 月 24 日
編集済み: G 2014 年 10 月 24 日
the real command will just get rid of the imaginary part, I want to ignore the whole complex value if possible.
Sean de Wolski
Sean de Wolski 2014 年 10 月 24 日
So More
des teg
des teg 2022 年 6 月 15 日
saved time Thanks

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeTwo y-axis についてさらに検索

タグ

質問済み:

G
G
2014 年 10 月 24 日

コメント済み:

2022 年 6 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by