I got a list like this
list={cond1,cond2,...}
, and I want to convert it to
cond1&&cond2&&...
How can I do that? I tried using
Do[ constrains = And[list[[i]]] , {i, Length[list]} ];
But it doesn't work, it's constantly evaluating the And[ ].
It's the command Apply, with its shortcut @@:
And@@{cond1,cond2,...}
Structurally, Apply[f,g[x1,x2,...]] removes g and replaces it with f. In our case, List[cond1, cond2, ...] becomes And[cond1, cond2, ...].
Apply[f,g[x1,x2,...]]
List[cond1, cond2, ...]
And[cond1, cond2, ...]