# error with dimensions in Simulink

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:

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

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.

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

inputs=[v,omega];

• thanks for your answer. I have tried the solutions that you have suggested me, but I still get the same error. – J.D. Oct 2 '20 at 6:59
• 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. – 50k4 Oct 2 '20 at 7:29
• 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.... – 50k4 Oct 2 '20 at 7:31