How to solve this error?

270 次查看(过去 30 天)
Priya
Priya 2014-1-22
移动DGM 2024-6-15
I keep getting this error while running the state space model,
Error in port widths or dimensions. Output port 1 of 'statespacemodel_hvm/Mux' is a one dimensional vector with 2 elements.
Error in port widths or dimensions. Input port 1 of 'statespacemodel_hvm/State-Space' has 3 elements. This port does not accept the dimensions (or orientation) specified by the input signal.
Please help me with this.
  4 个评论
Priyatham Ganta
Priyatham Ganta 2015-10-31
Can you help me specifically in this.. When i simulate this model, there's always an error
Ali
Ali 2024-2-27
移动:DGM 2024-6-15
Helllo everyone. I am having the same error. Im trying to model the inverter. but the same error is happening all the time

请先登录,再进行评论。

采纳的回答

Anuj
Anuj 2014-1-22
You are getting this error because your matrix dimensions are conflicting. Make sure that the dimensions of matrices in inputs and outputs must agree.
  6 个评论
Priya
Priya 2014-1-23
Ok. If I need the B matrix to be defined as the difference of the input and the wheelset's position (in my case it is the track input fed to the lateral position of the wheelset),do I have to design it in the model or give it in the mfile(ie., in the B matrix).
Since the state space model in Simulink consists of a track input(as step signal) given to the state space block with a mux.
Anuj
Anuj 2014-1-23
You can define it as you want, it depends on how you want to simulate it and how you find to do it easy.

请先登录,再进行评论。

更多回答(4 个)

Ta An Vo
Ta An Vo 2018-11-2
I also have the same error. Please help me solve.

Raghav Gopal Rao Netrakanti
Hi.
I am unable to solve this problem on my end as well.
Description:
I have a discrete state space system of 2 states, 2 inputs and 2 outputs. i.e all A B C D matrices are all 2 by 2. I used the discrete state space block and entered the values. Now my two inputs are 9400 by 1 vectors and i used the constant block to send them as input from the workspace. I have tried with mux and vector concantenate blocks, tried transpose but every time i get the same type of error
"Error in port widths or dimensions. Output port 1 of 'untitled/constant2' is a [9400x2] matrix
"Error in port widths or dimensions. Input port 1 of 'untitled/Discrete State-Space' has 2 elements. This port does not accept the dimensions (or orientation) specified by the input signal."
I hope someone can point out the mistake.
Regards,
Gopal
  1 个评论
Walter Roberson
Walter Roberson 2020-4-25
If your inputs are 9400 x 1 vectors and you are working with 2 x 2 arrays, then I guess you have two of the 9400 x 1 vectors as inputs, representing the two different inputs for "2 inputs and 2 outputs" ?
What output size are you expecting for this 9400 x 1 vector(s) ?If you are expecting to reduce it to 1 x 2 or 2 x 1 then you would need a state space system with 9400 rows or columns in some of the matrices

请先登录,再进行评论。


Tilakarathna K R
Tilakarathna K R 2020-8-19
sir im getting this error pls help me out
  3 个评论

请先登录,再进行评论。


Hiromasa
Hiromasa 2024-6-14
Thank you for your question.
As the error text suggests, the error comes from dimension conflicts between a port and a block.
Ctrl+D updates the Simulink model and shows the signal deminsion as below. The exmaple below also shows the same error messages. You see "?" on input signal and output signal for State Space block. This is because State Space block expects 3 dimension signal while Input port demension is set to 2. Similarly, the dimension conflict occurs between Mux and Outpout port.
You may want to update the dimensions of either ports and/or State Space block to resolve this dimension conflict. Hope this information helps.

类别

Help CenterFile Exchange 中查找有关 Signals 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by