I have recently updated from R2018a to R2018b. All the models I try to run in Simulink with any MPC Block or MPC controllers configured in Matlab fail with the error 'too many output arguments'. I have looked for shadowing and duplicated variable names etc and eliminated them but with no success.
So I opened a Mathworks example to see if that caused a similar issue. The first one I opened is 'Control of a Multi-Input Single-Output Plant' using the 'Open Script' button. I then ran the m file 'mpcmiso.m'. In this case the MPC controller configured in Matlab – the error I got mirrors that I have been getting with my own models:
>> mpcmiso
–>The "Weights.ManipulatedVariables" property of "mpc" object is empty. Assuming default 0.00000. –>The "Weights.ManipulatedVariablesRate" property of "mpc" object is empty. Assuming default 0.10000. –>The "Weights.OutputVariables" property of "mpc" object is empty. Assuming default 1.00000. Assuming no disturbance added to measured output channel #1.
Error using mpc/getStruct (line 304) Too many output arguments.
Error in mpc/sim (line 49) [MPCstruct, need_to_update, MPCobj] = getStruct(MPCobj);
Error in mpcmiso (line 44) sim(mpcobj,Tf,r,v)
If I used which to try and see if there is any shadowing issue I only get: >> which mpcobj -all mpcobj is a variable.
I have also tested 'ControlOfAnInvertedPendulumOnACartExample' from the example 'Control of an Inverted Pendulum on a Cart' which includes a Simulink MPC Controller Block and get the same error:
>> ControlOfAnInvertedPendulumOnACartExample
ans =
0 -11.9115 -3.2138 5.1253
–>The "Weights.ManipulatedVariables" property of "mpc" object is empty. Assuming default 0.00000. –>The "Weights.ManipulatedVariablesRate" property of "mpc" object is empty. Assuming default 0.10000. –>The "Weights.OutputVariables" property of "mpc" object is empty. Assuming default 1.00000. for output(s) y1 and zero weight for output(s) y2 –>Converting model to discrete time. –>The "Model.Disturbance" property of "mpc" object is empty: Assuming unmeasured input disturbance #1 is integrated white noise. Assuming no disturbance added to measured output channel #1. –>Assuming output disturbance added to measured output channel #2 is integrated white noise.
Error using mpc/getindist (line 43)
Too many output arguments.
Error in ControlOfAnInvertedPendulumOnACartExample (line 170) disturbance_model = getindist(mpcobj);
>> If I used which to try and see if there is any shadowing issue I only get:
>> which mdlMPC -all
mdlMPC is a variable.
Can any one help me stop this 'too many output arguments' error happening so that the models run please?
Best Answer