Plotting a complex number.

25 ビュー (過去 30 日間)
Ion Khan
Ion Khan 2014 年 7 月 25 日
回答済み: Roger Stafford 2014 年 7 月 25 日
Hi,
I am having a complex number say 4.3690e-34 + 1.3959e-18i and another number say 1.587E+11. When i use the function plot to plot these values, all I get is a blank Figure window along with a message that the imaginary part was ignored.
Any guidance is appreciated.
Ion Khan

回答 (3 件)

Roger Stafford
Roger Stafford 2014 年 7 月 25 日
I suggest you use 'plot3' with the frequency along one of the axes and the real and imaginary parts of your matrix along the other two respective axes. If you like, you can also combine that with a plot using zero instead of the frequency and it will exhibit the projection of the real/imaginary curve onto the corresponding plane.

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 7 月 25 日
What do you want to plot, the aplitude or the phase? If A is your array
plot(abs(A)) % plot the amplitude
figure
plot(angle(A)) % plot the phase
  2 件のコメント
Michael Haderlein
Michael Haderlein 2014 年 7 月 25 日
There's a third thing: Matlab can automatically plot real vs imag:
>> v=[1+2i;10+20i];
>> figure, plot(v)
>> xlabel('real'),ylabel('imag')
However, when I plot your data, I get the line plotted. What happens if you only plot the real part?
Azzi Abdelmalek
Azzi Abdelmalek 2014 年 7 月 25 日
I don't know what is your problem, you can plot whatever you want. Post your code with a sample of your data

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


Ion Khan
Ion Khan 2014 年 7 月 25 日
Hi,
Thanks for the responses!! I am actually trying to plot the determinant of a frequency dependant matrix vs the frequency itself in order to find the natural frequency.
The complex number 4.3690e-34 + 1.3959e-18i is the determinant and 1.587E+11 is the frequency. So its the amplitude and the phase, both required, so that the line meets x-axis at Natural Frequency. I defined frequency and found the determinant, then used the plot command for both of these. All it did was show up a empty Figure Window. I did try using abs and angle but its the same thing.
I will be using multiple entries and so want to keep it a little general and expect a shape like a mode shape of 3rd natural frequency a cantilever beam for instance.
Thanks!!

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by