I'm creating a plot of a family of lines using their endpoints and plotting it like so:
Graphics[Line[Table[{{x1, y1}, {x2, y2}}, {u, 0, 2 \[Pi], ustep}]]]
Where x1, y1, x2 and y2 have previously been defined in terms of u. The problem is that it is possible for this definition to produce an infinite result for a single pair of x and y. When this infinity is encountered, Mathematica complains and none of the lines are actually displayed. I'd like Mathematica to just glaze over the invalid one and display all the rest.
More details:
- There is a condition on u which could be used to find the problem point. (Let's just say $f(u) = 0$ for simplicity and generality.)
- I don't explicitly know a priori where this undefined value will occur in the table (or even that it will be present at all).
Is there any way to tell Mathematica to skip Table values based on some rule?
Is there any way to tell Mathematica to skip Table values based on some rule?
how aboutDeleteCases
? Example:DeleteCases[{1, 2, Infinity, 3, 4}, Infinity]
gives{1, 2, 3, 4}
orDeleteCases[{1, 2, Infinity, 3, 4, 1/0}, Infinity | ComplexInfinity]
$\endgroup$