My graph is empty

8 ビュー (過去 30 日間)
ukulele
ukulele 2021 年 3 月 17 日
コメント済み: Jan 2021 年 3 月 24 日
why my graph is empty?
if x<0
x=[0:0.01:-x];
xticks(0:0.01:-x)
a=200.*exp(-0.05.*x).*sin(x);
b=0.8.*exp(-0.5.*x).*sin(x.*10);
figure(1);
plot(x,a)
xticks(0:2:-x)
xlabel('Zaman')
ylabel('Frekans')
title('Düşük Frekans')
figure(2);
plot(x,b)
xlabel('Zaman')
ylabel('Frekans')
title('Yüksek Frekans')
figure(3);
yyaxis left
plot(x,a,"b")
ylabel('Düşük Frekans')
yyaxis right
plot(x,b,"r")
title('Frekans Tepkisi')
xlabel('Zaman')
ylabel('Yüksek Frekans')
  1 件のコメント
Jan
Jan 2021 年 3 月 24 日
@ukulele: Please stop deleting the text of your questions after answers have been given.

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

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 3 月 17 日
if x<0
x=[0:0.01:-x];
After the first time this code ran, negative scalar x would be replaced with a vector x that starts at 0 and increases. But then the second time you ran the code, unless you initialize x to something in previous code, then there would be no negative values in x, so the second time through the code would not pass the "if x<0" test.
  1 件のコメント
ukulele
ukulele 2021 年 3 月 17 日
i solved it before i saw this comment but thanks

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

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by