One way is to change the construction of Tab1
in the first place, and simply Join
together the ranges that you are going to keep.
Another is to use Select
, Cases
, or DeleteCases
to modify Tab1
. With Select
, one could do that as
Select[Tab1, Not[20 <= #[[1]] <= 50] && Not[125 <= #[[1]] <= 150] &]
This applies the function in the second argument to each element of the list, and throws away the ones that give False
, keeping ("selecting") only those that give True
.
As @Louis B mentioned in a comment, you can also represent the interval as Interval[{20, 50}, {125, 150}]
, and test for membership via IntervalMemberQ
. As @Louis B says, the corresponding function to use in the second argument would be Not @ IntervalMemberQ[Interval[{20,50}, {125,150}], First[#]] &
.
With DeleteCases
, one could do that as
DeleteCases[Tab1, {_?(20 <= # <= 50 || 125 <= # <= 150 &), _}]
This deletes all parts of the expression that match the pattern in the second argument, which matches any list of two expressions, the first of which yields true under the function enclosed in parentheses after ?
. Another way to write that pattern is
DeleteCases[Tab1, {x_, _} /; (20 <= x <= 50 || 125 <= x <= 150)]
where x
now names the first blank pattern, and /;
can be read as "on the condition that".
Hope this helps; let me know if anything is unclear or mysterious!
Tab1
uses a step size of1 Degree
. This means that in computing\[Alpha]
, you wind up with something of unitsDegree^2
. Is this intentional? If the bounds 0 and 190 represent degrees, I suspect the step size should be 1. $\endgroup$ListPlot[Select[Tab1, Not@IntervalMemberQ[Interval[{20, 50}, {125, 150}], First[#]] &]]
$\endgroup$