Loglog plot not plotting anything

So I am trying to plot this log function, but nothing is being plotted on the graph. The figure pops up, but there is nothing on the figure. I know that it's mainly because my Zeq matrix values are getting NaN + NaNi but I am not sure how to fix that
My Code is below:
f = logspace(10, 10E9);
C1 = 2.33E-10;
Cox = 4.77E-5;
C = 2.8E-15;
g2 = 1/(4*10^-3E-3)*(Cox).*f;
g1 = 1/(4*10^-3E-3)*(C).*f;
L1 = 0.0118;
r1 = 1.42;
r = 6.818E-6.*sqrt(f);
s = 1i*2*pi.*f;
x = 1./((g2+(1./(s.*C1)).*(r1 + 1./(s.*Cox))) ./ (g2+(1./(s.*C1))+(r1 + 1./(s.*Cox))));
y = r + s.*L1 + ((g1./(g1.*s*C) + 1));
z = 1./y;
Zeq = 1./(x+z);
loglog(f,abs(Zeq));
grid on;

2 件のコメント

Rik
Rik 2020 年 9 月 23 日
There is only 1 point that isn't an (inf,NaN) pair.
Star Strider
Star Strider 2020 年 9 月 23 日
Your code works with my correction.

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

回答 (1 件)

Star Strider
Star Strider 2020 年 9 月 23 日

0 投票

The logspace call is wrong.
If you want ‘f’ to go from 10 to , call it as:
f = logspace(1, 9, 50);
That creates a 50-element vector between those limits.

カテゴリ

ヘルプ センター および File ExchangePolar Plots についてさらに検索

製品

質問済み:

2020 年 9 月 23 日

コメント済み:

2020 年 9 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by