フィルターのクリア

Error while plotting the polar plot

2 ビュー (過去 30 日間)
CHANDRABHAN Singh
CHANDRABHAN Singh 2021 年 9 月 22 日
コメント済み: CHANDRABHAN Singh 2021 年 9 月 22 日
%I have an expression which is plotted using the polarplot.
a = 1/(2.*cos(theta))
e = 0.5;
thet = -60:1:60;
theta = thet .*(pi/180);
c = cos(theta);
p = 4*(1-e^2).*(c.^2) + (2*e - 1)^2;
q = 2*(1-e*e).*c + (2e-1)*sqrt(4*(1-e*e).*(c.^2) + 5 *e*e - 4*e);
r = q./p;
polarplot(theta,r);
hold on;
%Now if i solve the expresion for e=0.5 analytically and then try plotting the expression
a = 1./(2.*cos(theta));
polarplot(theta,a);
hold off;
%Why the graphs are not same while both the expressions are same.

回答 (1 件)

Chunru
Chunru 2021 年 9 月 22 日
e = 0.5;
thet = -60:1:60;
theta = thet .*(pi/180);
c = cos(theta);
p = 4*(1-e^2).*(c.^2) + (2*e - 1)^2;
% q = 2*(1-e*e).*c + (2e-1)*sqrt(4*(1-e*e).*(c.^2) + 5 *e*e - 4*e);
% 2e-1 is the number 2x10^(-1), rather than 2*e-1 !!!
q = 2*(1-e*e).*c + (2*e-1)*sqrt(4*(1-e*e).*(c.^2) + 5 *e*e - 4*e);
r = q./p;
polarplot(theta,r);
hold on;
a = 1./(2.*cos(theta));
polarplot(theta,a);
hold off;
  1 件のコメント
CHANDRABHAN Singh
CHANDRABHAN Singh 2021 年 9 月 22 日
Thanks.

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

カテゴリ

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

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by