MATLAB: Creation of a simulink block from a Mupad expression containing subscripts.

MATLABmatlab functionmupadsimulinksubscriptssymbolic mathematics toolbox

Why are you using MuPAD instead of Symbolic Math Toolbox? MuPAD notebooks are not recommended.

Best Answer

Use Mux block to get theta 1 ... N. You need so many inputs. The Mux will create the array for you. Take this as a single input u into the model (Matlab function). in the function compute y = sum(sin(u).*cos(u)). note the '.*' for element multiplication.