New answers tagged

1

I suppose you would like something like this? Select[A.B.Transpose[R].R.T, FreeQ[#, R] &] This mainly used the expression's tree like property. Due to Dot's Flat Property, the whole expression will actually looks like Dot[A,B,Transpose[R],R,T], thus this code can generate the result you want: A.B.T Note that I've change your C to T cause C is a ...


2

Cases[square, Polygon[x_, ___] :> x, Infinity][[1]] or square[[1, 1]] both give {{0, 0}, {0, 1}, {1, 1}, {1, 0}}


2

Try the following code: Extract[square,Position[square,{_,_}]] Maybe this will help. In a 2-D graphics object, generally this code can extract all the coordinates. Maybe there'll have some problem e.g. like some options with the same form..... I'm currently typing with my tiny phone without my computer, so if there's anything wrong with my code (not ...


10

ClearAll[a, b]; a := 1 + 1 b = Sqrt Is this acceptable? foo = # /. Join @@ Cases[#, s_Symbol :> OwnValues[s], ∞, Heads->True] &; foo @ Hold[a + b[c]] Hold[(1 + 1) + Sqrt[c]] Update As OP has noticed I've missed the fact that ReadProtected symbols won't show its OwnValues. We could do something like s_Symbol /; FreeQ[ Attributes[s], ...



Top 50 recent answers are included