You should probably just use matlabFunction with the 'vars' option. Pass in a cell array. Within the cell array, each variable that is listed in the same entry will be bundled into a single parameter. So for example if you had
q = symvar('q', [1 150]);
p = symvar('p', [1 30]);
testRecords.funcObsw3 = matlabFunction(tests.test5.symbolicObsW{3,1}, 'vars', {q, p})
then the function would be created with two parameters, one of which was expected to be a row vector of length 150, and the other was expected to be a row vector of length 30.
Warning: Function 'sq' not verified to be a valid MATLAB function.
You appear to be trying to mix array indexing with symbolic work. That will fail most of the time: never try to index with a symbolic variable (unless you really really know what you are doing.)
Best Answer