I can do this in MatLab/MATLAB:
When I try to wire multiple inputs into a case structure then I get wire errors.
These are limited cases, not exhaustive. These are numeric inputs, not text or boolean. There has to be a way where I can wire an array or such into a case structure.
What am I doing wrong?
Solved! Go to Solution.
There isn't a way to wire an array or multiple numerics into a case selector.
The first suggestion that comes to mind would be to convert the three numbers to strings and then concatenate them all into one string. Then you could wire the string into the case structure and program each of the possible cases.
This can easily be done using the string conversion VI's.
Case structures accept integer numeric types as selectors.
One possibility would be nested case structures with a, b, and c wired to different ones. Another method would be to do some simple math to combine the three inputs into a single numeric value and use that as the selector for one case structure. The difficulty of this approach depends on the ranges of possible values for the inputs.
It is extremely inelegant, but you can do the exact equivalent code with the Select function and comparators. Note that this code has an "unspecified case" ("None of the above") which you have not defined, but I defined as -12345.
Note -- I absolutely do not recommend doing this in "real code". Think about what you really want to do (which is almost certainly not "encode a very limited set of three-digit numbers").
@Jeff - I have 2015 so the snippet isn't transferring. What is the name of the vi that you connect both "A" and "B" to?
That's "Join Numbers", found on the Numeric Palette under Data Manipulation. And it definitely is elegant, and does not let you make the mistake of "Oops, there's a case I didn't consider", as the numeric Case statement requires a Case for every possible numbers, hence the "Default" Catch-All (a.k.a. a "Terminal ELSE").