I am using a symbolic toolbox to create a matlab function. But the number of input data into the generated function varies depending on the number of objects I need (for example, the number of switches). For 2 and 3 switches, the generated function looks like this:
y = fun(a1,a2,b1,b2) y = fun(a1,a2,a3,b1,b2,b3)
In a script using this function, I set the vectors of these parameters:
a = [a1 a2 ...]
I want to either call the generated function directly, or make a wrapper function, so I donโt need to change the call statement when I change the number of switches. To complicate this problem, these variables are ACADO variables. This means that matrix and elemental operations are not allowed (i.e., the entire mathematical operation must be performed with scalars, and the equations in the symbolic toolbar must be written for scalars).
source share