Plotting a complex number.
조회 수: 25 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (3개)
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.
댓글 수: 0
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
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
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!