I'm trying to figure out if a calculation result it's a valid result. As it return a matrix, I need to test that every element it's a number, so I thought this could work...
numericTable = Range[12] ~Partition ~ 4;
check=( NumberQ/@Flatten@numericTable) /.List->Sequence ;
And[check]
This should return True or False depending if exist or not a non-numerical element in the matrix. But it returns
Sequence[True,True,True,True,True,True,True,True,True,True,True,True]
So I don't understand anything, because...
In[]:= Sequence[True,True,True,True,True,True,True,True,True,True,True,True]===check
And[Sequence[True,True,True,True,True,True,True,True,True,True,True,True]]
Out[]= True
Out[]= True
Where's the catch ???
And @@ (NumberQ /@ Flatten@numericTable)? – Pinguin Dirk Feb 21 '13 at 16:41MatrixQandNumberQas in the docs ? – b.gates.you.know.what Feb 21 '13 at 16:42HoldAllattribute ofAnd- thus,And[evaluate@check]works. But I have to admit I am not sure... – Pinguin Dirk Feb 21 '13 at 16:59Plot[Evaluate[Sequence[Sin]][x], {x, 0, 2 \[Pi]}]withPlot[Sequence[Sin][x], {x, 0, 2 \[Pi]}]... Plot has alsoHoldAll– Dr. belisarius Feb 21 '13 at 17:01MatrixQ[numericTable, NumberQ]seems reasonable – Rojo Feb 21 '13 at 17:13