フィルターのクリア

Plot of complex numbers

1 回表示 (過去 30 日間)
Sk. Sarif Hassan
Sk. Sarif Hassan 2014 年 10 月 26 日
コメント済み: Sk. Sarif Hassan 2014 年 10 月 26 日
I have a code as follows
clc;
clear all;
a=randi([-100, 100]);
b=randi([-100, 100]);
c=randi([-100, 100]);
d=randi([-100, 100]);
alpha=complex(randi([-100, 100]), randi([-100, 100]));
beta=complex(randi([-100, 100]), randi([-100, 100]));
z0=complex(a,b);
z1=complex(c,d);
k=100;
for n=1:k
Z=(alpha/z0)+(beta/z1)
z0=z1;
z1=complex(real(Z),imag(Z));
end
I want to save the complex numbers which are generated over 100 iterations and also would like to plot this complex numbers in complex plane (2D).
Any help please.

回答 (1 件)

Rick Rosson
Rick Rosson 2014 年 10 月 26 日
編集済み: Rick Rosson 2014 年 10 月 26 日
z1 = complex(zeros(k,1);
for n=1:k
Z=(alpha/z0)+(beta/z1)
z0=z1;
z1(n)=complex(real(Z),imag(Z));
end
figure;
plot(z1);
  1 件のコメント
Sk. Sarif Hassan
Sk. Sarif Hassan 2014 年 10 月 26 日
Something wrong here. Can you please check and add this part with draft code I made.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by