필터 지우기
필터 지우기

&& 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 CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by