Counting Euler Angle Ranges

15 ビュー (過去 30 日間)
James Stafford
James Stafford 2017 年 10 月 26 日
回答済み: Roger Stafford 2017 年 10 月 26 日
I have head rotation values that range from 0-360 degrees and I want to note when the head enters between 30 and 60 degrees. The issue I have is when the head enters this range my code detects every value within this range when I want it to only document it entering the range once then note when it has left the range again. How do I achieve this? This is the code I used but want to alter:
lowerboundUp=60; lowerboundLow=30;
index=lookDirection<lowerboundUp | lookDirection>lowerboundLow; lookDirection(index)=[];
Thank you for all your help.

採用された回答

Roger Stafford
Roger Stafford 2017 年 10 月 26 日
Assuming your rotation values, ‘r’, are successively indexed by, say, ‘ix’, then use
(r(ix-1)<30 | r(ix-1)>60) & r(ix)>=30 & r(ix)<=60
for an entry into the range and
r(ix-1)>=30 & r(ix-1)<=60 & (r(ix)<30 | r(ix)>60)
for an exit.

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by