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 = {Condition_1, Value_1, Condition_2, Value_2, Condition_3, Value_3, … , Condition_30, Value_30}
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, Condition_1, Value_1, Condition_2, Value_2, Condition_3, Value_3, … ]