My graph is empty

10 vues (au cours des 30 derniers jours)
ukulele
ukulele le 17 Mar 2021
Commenté : Jan le 24 Mar 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 commentaire
Jan
Jan le 24 Mar 2021
@ukulele: Please stop deleting the text of your questions after answers have been given.

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 17 Mar 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 commentaire
ukulele
ukulele le 17 Mar 2021
i solved it before i saw this comment but thanks

Connectez-vous pour commenter.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by