I'm doing some heavy symbolic calculations and for preliminary simple tests I need to replace all coefficients except chosen with 1, e.g.:
eq = a b c d e f g ...
Replace[eq, Except[a | b] -> 1]
a b ...
Surely that's not working, just illustration. How can I do this?
A little remark: eq/.(c|d|e|f|g|...)->1
will give what I want, but the point is there could be too many coefficients with different names, so it's much easier to write down only the those I want to keep.
Comments
Post a Comment