My graph is empty

8 Ansichten (letzte 30 Tage)
ukulele
ukulele am 17 Mär. 2021
Kommentiert: Jan am 24 Mär. 2021
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 Kommentar
Jan
Jan am 24 Mär. 2021
@ukulele: Please stop deleting the text of your questions after answers have been given.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 17 Mär. 2021
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 Kommentar
ukulele
ukulele am 17 Mär. 2021
i solved it before i saw this comment but thanks

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by