Is there any way to completely remove the head of an expression function?
For example, how would I remove the head
Cos[a] to give only
a as an output.
You can actually
One case of interest may be held expressions. If our expression is:
And the head we wish to remove is
All produce e.g.:
We can use
You could also use a pattern that includes the surrounding expression on the right-hand-side, as demonstrated here, e.g.:
As the documentation for
Since this resolves to
(this is just a long-winded way of producing a list), then
You remove a head by replacing it with
For doing this over lots of expressions:
Does this come close?