フィルターのクリア

plotting lines

2 ビュー (過去 30 日間)
Muhammad Usman
Muhammad Usman 2011 年 12 月 11 日
i have a simple ques that if i have z-plane having x and y axes,and i express z=x+i*y,and x if fixed let say 5 any y=0:10 then how can i plot this thing,please guide me,i m waiting for reply
  1 件のコメント
Muhammad Usman
Muhammad Usman 2011 年 12 月 12 日
yes i is imaginaryunit

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

回答 (3 件)

bym
bym 2011 年 12 月 11 日
y = 1:10;
x=5*ones(size(y));
z=x+i*y;
plot(real(z),imag(z))
  1 件のコメント
Walter Roberson
Walter Roberson 2011 年 12 月 11 日
That will not be able to show the values of x and y on the axes.

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


Mohsen  Davarynejad
Mohsen Davarynejad 2011 年 12 月 11 日
y = [0:.1:10]
plot(5,y)
xlabel('Re')
ylabel('Im')
  3 件のコメント
Mohsen  Davarynejad
Mohsen Davarynejad 2011 年 12 月 11 日
If z = x + yi, then x is the "real part" and y is the "imaginary part". When x is a constant and y is vector, then you will have line in the complex plane. No?
http://en.wikipedia.org/wiki/Imaginary_number
Walter Roberson
Walter Roberson 2011 年 12 月 12 日
z might be a line in the complex plane, but plot(5,y) does not involve z at all, and plot(5,z) would be refused because it is not allowed to plot complex data except through plot(z) which in turn is the same as plot(real(z),imag(z)) -- real vs imaginary.

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


Walter Roberson
Walter Roberson 2011 年 12 月 11 日
y = 0:10;
x = 5 * ones(size(y));
z = x + i * y;
Now, if "i" were a real-valued constant, you would then use
plot3(x, y, z)
However, "i" is the complex constant, so you have a line in complex space, and there is no way to draw that in one step. Instead you would need to use something like,
plot3(x, y, real(z), 'r', x, y, imag(z), 'g', x, y, abs(z), 'b')
or perhaps plot 3 separate images using subplot()
  1 件のコメント
Muhammad Usman
Muhammad Usman 2011 年 12 月 12 日
i just tried your code where "i" is complex constant...now i want to ask that how can a draw a rectangle shape and color it on the axes,i.e.let x=0:5 and y=0:7 and these lines meet at(5,7),so guide me.

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

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by