How to solve this error?

572 views (last 30 days)
Priya
Priya on 22 Jan 2014
Answered: Ali on 27 Feb 2024
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.
  3 Comments
Azzi Abdelmalek
Azzi Abdelmalek on 22 Jan 2014
No, you can do it in this forum
Priyatham Ganta
Priyatham Ganta on 31 Oct 2015
Can you help me specifically in this.. When i simulate this model, there's always an error

Sign in to comment.

Accepted Answer

Anuj
Anuj on 22 Jan 2014
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 Comments
Priya
Priya on 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 on 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.

Sign in to comment.

More Answers (4)

Ta An Vo
Ta An Vo on 2 Nov 2018
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 Comment
Walter Roberson
Walter Roberson on 25 Apr 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

Sign in to comment.


Tilakarathna K R
Tilakarathna K R on 19 Aug 2020
sir im getting this error pls help me out
  3 Comments
Dmitriy Ogureckiy
Dmitriy Ogureckiy on 24 Dec 2022
How make that?

Sign in to comment.


Ali
Ali on 27 Feb 2024
Helllo everyone. I am having the same error. Im trying to model the inverter. but the same error is happening all the time

Tags

Community Treasure Hunt

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

Start Hunting!