Hi Friends, I am trying to use Switch function for a programming problem. Having a large number of condition/value sets coming from a previous calculations, I can not write them manually in "Switch" function, though they are present in a row matrix form. How can import this matrix to switch function so that it can work smoothly ? I have already tried the functions like Grid, Flatten, Sequence etc., nothing seems to work. Will appreciate any suggestion. Attached is the *nb file having a small example of this problem. Thanks
What I have -
Matrix = {Condition1, Value1, Condition2, Value2, Condition3, Value3, ........... , Condition30, Value30}
What i want -
Function ABCD which can be used with switch function as -
Switch[expression, ABCD[Matrix]]
to give similar o/p as -
Switch[expression, Condition1, Value1, Condition2, Value2, Condition3, Value3, .... ]
Attachments: