My graph is empty
7 views (last 30 days)
Show older comments
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 Comment
Jan
on 24 Mar 2021
@ukulele: Please stop deleting the text of your questions after answers have been given.
Answers (1)
Walter Roberson
on 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.
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!