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 CenterFile Exchange에서 2-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