フィルターのクリア

&& trouble !

17 ビュー (過去 30 日間)
Twinkle
Twinkle 2011 年 9 月 20 日
if i make an array of delta(i) such that delta(i)=atan2(x,z) then the code: if ((delta(i)<0) && (delta>=pi)) delta(i)=2*pi+delta(i);
gives error: operands && operators must be convertible to logical scalar values
help me out if u can !
  1 件のコメント
Jan
Jan 2011 年 9 月 20 日
It is impossible that delta(i) is smaller than zeros *and* greater equal Pi at the same time. Therefore the IF condition is FALSE ever. In addition the reply of ATAN2 is smaller equal Pi ever.

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

採用された回答

Sean de Wolski
Sean de Wolski 2011 年 9 月 20 日
delta is apparently an array with more than one element so in the second part of the conditional delta>pi will also be non-scalar. You probably meant
delta(i)>=pi
  1 件のコメント
Twinkle
Twinkle 2011 年 9 月 21 日
Yeah..i meant that! got it right now ! Anywayz thanks for your help !

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by