フィルターのクリア

Variable reconnaissance problem with function polar

2 ビュー (過去 30 日間)
federico trovarelli
federico trovarelli 2015 年 5 月 23 日
回答済み: Walter Roberson 2015 年 5 月 26 日
Hello,
I don' understand the reason why the funcion polar does not recognise rhop as a function o nu2?
I hope someone can help me. The error code is below
Thanks.
e2=0.0935;
p2=1.524;
OMEGA2=0.865;
omega2=5.864;
i2=0.0323;
nu2=2.6643:.01:3.003;
rhop2=p2*cos(nu2)\(1+e2*cos(nu2));
>> figure
>> polar(nu2,rhop2,'--r');
Error using polar (line 60)
THETA and RHO must be the same size.

回答 (2 件)

Ashish Gudla
Ashish Gudla 2015 年 5 月 26 日
I understand that you are trying to use POLAR function and running into error. As the error message states, the dimensions of 'nu2' and 'rhop2' are different.
From the code you provided 'nu2' is 1x34 double however 'rhop2' is a 34x34 double. For the POLAR function to plot correctly the dimensions need to match. Please refer to the following doc page for more information:

Walter Roberson
Walter Roberson 2015 年 5 月 26 日
I suspect that instead of
rhop2=p2*cos(nu2)\(1+e2*cos(nu2));
that you mean
rhop2=p2*cos(nu2)./(1+e2*cos(nu2));

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by