From: EJ Jewell on
Hi,

I am trying to use a state-space block in Simulink. I have several (eventually need 100) and would like to find their sum as well as being able to use just the last element. I currently am trying to run my model with just four states. I have

mux-->function-->state-space-->demux

I have set the demux to have one input and four outputs. However, I am getting these errors:

--> Invalid setting for input port dimensions of 'sc10/Demux'. The
dimensions are being set to [-1]. This is not valid because the total
number of input and output elements are not the same.
--> Error in port widths or dimensions. Invalid dimension has been
specified for output port 1 of 'sc10/State-Space2'.

It seems like if I fix the second one, that may also resolve the first one, but I am not sure. If anyone could help me, I would appreciated it greatly. Thank you!
From: Guy Rouleau on
"EJ Jewell" <gsp_sydney(a)yahoo.com> wrote in message <hq2lam$8i9$1(a)fred.mathworks.com>...
> Hi,
>
> I am trying to use a state-space block in Simulink. I have several (eventually need 100) and would like to find their sum as well as being able to use just the last element. I currently am trying to run my model with just four states. I have
>
> mux-->function-->state-space-->demux
>
> I have set the demux to have one input and four outputs. However, I am getting these errors:
>
> --> Invalid setting for input port dimensions of 'sc10/Demux'. The
> dimensions are being set to [-1]. This is not valid because the total
> number of input and output elements are not the same.
> --> Error in port widths or dimensions. Invalid dimension has been
> specified for output port 1 of 'sc10/State-Space2'.
>
> It seems like if I fix the second one, that may also resolve the first one, but I am not sure. If anyone could help me, I would appreciated it greatly. Thank you!

Hi,

here are a few tips that might be helpful:

- I am not sure what your "function" block does. if you remove it and just feed the state space block with a constant of the desired dimension? Also what is connected after the demux can influence, try connecting just a display to each signal for debugging.

- If you want the demux to split a vector of 4 elements into 4 individual signal, you might want to try setting it to [ 1 1 1 1]. That way you explicity telle simulink that you expect an in put vector of 4 elements.

- For debugging, you might want to insert "signal specification" block on some of the signals (like before and after the spatespace block for example). Specify the dimension you expect in this block, the error message might point more accuratly to the source of the issue.

I hope this helps.

Guy
From: EJ on
Thanks for the help! I will try these things. EJ