I am trying to simulate a cartesian regulator for a unicycle with Simulink and I am having some problems.

My simulink model is the following:

enter image description here

and when I run it I get the following error message:

enter image description here

so it seems I am doing something wrong with the dimensions.

I have added also some ToWorkspace blocks since I want to use the results to do some plots.

I have not very good at using Simulink, so I am having a lot of problem and I don't know how to solve the error message I get.

Cab somebody please help me?


1 Answer 1


Split the output of the regulator into to seperate signals.

function [v_out, omega_out] = C_REG(q)
v_out = v;
omega_out = omega;

You are probably compounding the signals in a different way then Simulink is trying to demux it. You can use a Mux block if you really want just one signal path.

There is also a change that simply changing the last line to a row vector instead of a column vector could also help

  • $\begingroup$ thanks for your answer. I have tried the solutions that you have suggested me, but I still get the same error. $\endgroup$
    – J.D.
    Oct 2, 2020 at 6:59
  • 1
    $\begingroup$ In the case when you have 2 output signals from your regulator block, and use a mux to compound these signals, at least the error message has to change. $\endgroup$
    – 50k4
    Oct 2, 2020 at 7:29
  • $\begingroup$ Alternatively you can try to remake the u(1)*sin(u2) part with multiplier blocks. Maybe the reference to the elements of the input signals causes the problems.... $\endgroup$
    – 50k4
    Oct 2, 2020 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.