I have a list
m={a,b,c,d};
How can I insert $==0$ to get list of equations so that the function Solve can take it as an argument?
m={a==0,b==0,c==0,d==0}
How to remove curly brackets to get?
m=a==0,b==0,c==0,d==0
The following
Thread[Flatten /@ (m == Table[0, Length@m])]
MapThread[Equal, {m, Table[0, Length@m]}]
Inner[Equal, m, Table[0, Length@m], List]
Equal @@@ Transpose[{m, Table[0, Length@m]}]
Internal`InheritedBlock[{Equal}, SetAttributes[Equal, Listable];
m == Table[0, Length@m]]
Edit:
About the second part of the question... I don't really understand what you mean. Perhaps the following?
Extract[1]@{a == 0, b == 0, c == 0, d == 0}
eqns = Table[lhs == 0, {lhs, m}]
eqns = Map[EqualTo[0],m]
eqns = Thread[Equal[m, 0]] (* Credit Syed *)
To use as arguments you can do
f[1,2,Sequence@@eqns]
m = {a, b, c, d};
Using Cases
Cases[m, x_ :> x == 0]
Using MapAt
MapAt[# == 0 &, All] @ m
Using ReplaceAt
(new in 13.1)
ReplaceAt[x_ :> x == 0, All] @ m
All return
{a == 0, b == 0, c == 0, d == 0}
m = {a, b, c, d};
Using Outer
and MapApply
:
# == 0 & @@@ Outer[List, m]
{a == 0, b == 0, c == 0, d == 0}
eqs = Thread[Equal[m, 0]]
$\endgroup$eqs = # == 0 & /@ m
$\endgroup$Replace[m, a_ -> a == 0, 1]
$\endgroup$m /. {List -> List, a_Symbol -> a == 0}
$\endgroup$