Unable to see Graph

1 回表示 (過去 30 日間)
SARVESH AGRAWAL
SARVESH AGRAWAL 2017 年 11 月 1 日
コメント済み: SARVESH AGRAWAL 2017 年 11 月 2 日
Hi,
Following is the code of sinc function which I am trying to plot. However, I do not see anything. Any help will be appreciated.
h=5;
lambda=h;
beta=2*pi/lambda;
for theta=0:0.01:2*pi
T=abs(sinc(beta*h*cos(theta)));
% T=sin(beta*h*cos(theta))/(beta*h*cos(theta));
polarplot(theta,T);
hold on;
end

採用された回答

Eric
Eric 2017 年 11 月 1 日
Instead of using a for loop, take advantage of matlab's ability to work with vectors (don't forget the element-wise period for T2):
h=5; lambda=h; beta=2*pi/lambda;
theta=0:0.01:2*pi;
T1=abs(sinc(beta.*h.*cos(theta)));
T2=sin(beta.*h.*cos(theta))./(beta.*h.*cos(theta));
polarplot(theta,T1);
hold on;
polarplot(theta,T2);
  1 件のコメント
SARVESH AGRAWAL
SARVESH AGRAWAL 2017 年 11 月 2 日
Thank you sir!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by