Processing purely imaginary numbers

17 ビュー (過去 30 日間)
Alex Wylie
Alex Wylie 2017 年 2 月 14 日
コメント済み: Adam 2017 年 2 月 15 日
Hey,
I've got a vector of purely complex numbers (ie. the real component = 0). However the processing time of it is taking a long time and I think it's because MATLAB is doing conjugate multiplication. When I print out the vector is is in the form 0 + bi .. how can I make Matlab just read it as a purely imaginary number such as bi and process it quicker?
Thanks for your time, Alex.

採用された回答

Adam
Adam 2017 年 2 月 14 日
You can just use
imag( myVector )
to get the imaginary part as a standard non-complex double and then do your maths on that, as though it where the imaginary component.
  2 件のコメント
Alex Wylie
Alex Wylie 2017 年 2 月 15 日
I didn't meant to accept it, I actually need to do my maths on an imaginary number and imag(A) just gets the imaginary component of the vector and turns it real. I need imaginary ...
Adam
Adam 2017 年 2 月 15 日
Does the maths re-introduce a real part? In which case there is probably no alternative to just using it as is. If it doesn't I don't see why you need it as imaginary. You can turn it back to imaginary at the end of the maths if it stays purely imaginary throughout.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by