Info
此问题已关闭。 请重新打开它进行编辑或回答。
hi :) I need help , I have an array of float angles , I want to find the indexes of angles in the range -pi/M<theta<=pi/M thanks
1 次查看(过去 30 天)
显示 更早的评论
I try the following code:
(The problem is that this gives me also theta = -pi/M )
tolerance = 10^-4
M = 4;
thetaindxes_in_range = find(abs((abs(theta(:,1))-pi/M)<=tolerance));% theta
0 个评论
回答(1 个)
Image Analyst
2017-6-3
Then don't use abs(). Do each comparison separately. Like this:
M = 4;
indexesInRange = (theta > -pi/M) & (theta <= pi/M)
theta_in_range = theta(indexesInRange)
3 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!