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 commentaires

Azzi Abdelmalek
Azzi Abdelmalek le 22 Jan 2014
Priya, you've just showed the error message, How are we supposed to know what is in your model?
Azzi Abdelmalek
Azzi Abdelmalek le 22 Jan 2014
No, you can do it in this forum
Priyatham Ganta
Priyatham Ganta le 31 Oct 2015
Can you help me specifically in this.. When i simulate this model, there's always an error
Ali
Ali le 27 Fév 2024
Déplacé(e) : DGM le 15 Juin 2024
Helllo everyone. I am having the same error. Im trying to model the inverter. but the same error is happening all the time

Connectez-vous pour commenter.

 Réponse acceptée

Anuj
Anuj le 22 Jan 2014

0 votes

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 commentaires

Priya
Priya le 22 Jan 2014
Thank you. Now I get another error saying
Error using horzcat Dimensions of matrices being concatenated are not consistent.
Please tell what does this mean?
You have something of the form
[A B]
where A has a different number of rows than B has.
Priya
Priya le 23 Jan 2014
Modifié(e) : Priya le 23 Jan 2014
What function is used to define the input matrix B which is of size 14x2? The size of matrix A is 14x14. If I give it as B=zeros(size(A,1),2), I get a blank line at zero. Why is this so?
The result of B shows two columns of zeros using the above function. But I need some value for the B matrix. I'm bit confused about this.
Please do help me.
Anuj
Anuj le 23 Jan 2014
You need to define your B matrix according to system input, If you define it as B=zeros(size(A,1),2), all elements of B will be zero. I hope this helps.
Priya
Priya le 23 Jan 2014
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 le 23 Jan 2014
You can define it as you want, it depends on how you want to simulate it and how you find to do it easy.

Connectez-vous pour commenter.

Plus de réponses (4)

Ta An Vo
Ta An Vo le 2 Nov 2018

0 votes

I also have the same error. Please help me solve.

0 votes

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 commentaire

Walter Roberson
Walter Roberson le 25 Avr 2020
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

Connectez-vous pour commenter.

Tilakarathna K R
Tilakarathna K R le 19 Août 2020

0 votes

sir im getting this error pls help me out

3 commentaires

Walter Roberson
Walter Roberson le 19 Août 2020
Simulink cannot tell what the actual size of the input is for From2, but knows it is at least 3 elements. That value is feeding into the second input of the MUX, which where it is expected to be only a single element.
You can probably get further by defining exact sizes for some of the ports instead of marking them as "inherit"
Dmitriy Ogureckiy
Dmitriy Ogureckiy le 24 Déc 2022
How make that?

Connectez-vous pour commenter.

Hiromasa
Hiromasa le 14 Juin 2024

0 votes

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.

Tags

Question posée :

le 22 Jan 2014

Déplacé(e) :

DGM
le 15 Juin 2024

Community Treasure Hunt

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

Start Hunting!

Translated by