Error in port widths or dimensions

52 Ansichten (letzte 30 Tage)
kartik
kartik am 24 Apr. 2012
Beantwortet: Md Rakibul am 26 Feb. 2014
Hi, I am getting error like"Error in port widths or dimensions. Output port 1 of 'Furutroo/Compensator/y' is a one dimensional vector with 4 elements." I am using state-space block with single i/p and o/p. My all metrices are as follows
Acroo =
1.0e+004 *
0.8113 -0.5777
1.2184 -0.8680
Dcroo =
76.6721 21.3142
Bcroo =
1.0e+005 *
-0.7663 -0.2115
-1.1516 -0.3146
Ccroo =
-8.1284 5.7804
please help me how can i resolve the problem. If you want files give me your e-mail id. My id is knp28@njit.edu.
hit on search by image, you will able to see block dia
Regards, kartik pathak
  3 Kommentare
kartik
kartik am 27 Apr. 2012
Hi Kaustubha,
I could not able to upload or paste model herecan you give me your e-mail id so that i can send it to you directly?
Walter Roberson
Walter Roberson am 28 Apr. 2012
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers

Melden Sie sich an, um zu kommentieren.

Antworten (4)

Kaustubha Govind
Kaustubha Govind am 30 Apr. 2012
Your input to the State-Space block has a dimension of 1x4, but B has dimensions 2x2 - this doesn't make sense because you can't multiple a 2x2 matrix with a 1x4 vector. Your input must be a vector of 2 elements as Guy suggested.

Guy Rouleau
Guy Rouleau am 27 Apr. 2012
I don't know where the 4 comes from in your error message, but your B and D matrices have 2 columns, so your system should have 2 inputs.
Try leaving unconnected or grounded lines where the error is and display the signal width (from the format menu). this should help understanding what's going on.
  1 Kommentar
kartik
kartik am 28 Apr. 2012
Hi Guy i attached block dia in above link please take a look and advice me

Melden Sie sich an, um zu kommentieren.


java python
java python am 19 Jan. 2013
I have a simulink model of UAV model which ran fine in 2010b and 2012a model in my school's computer. But when run exact same block in 2012b, it guves me the error message ,"Error in port widths or dimensions. Output port 1 of ...." . In the bottom window, it says "Error in port widths or dimensions. Input port 1 of 'sldSim/sldDynamics/MATLAB Fcn' has 17 elements. This port does not accept the dimensions (or orientation) specified by the input signal."
I don't see any non-uniformity with the dimensions. Even if there was a problem why would it run in previous versions ? Does 2012b simulink has any bugs ? Please help me .
  1 Kommentar
Kaustubha Govind
Kaustubha Govind am 1 Feb. 2013
Sumit: Your question is unrelated to this thread (despite the error message being the same) because the cause is clearly different. Please start a new question.

Melden Sie sich an, um zu kommentieren.


Md Rakibul
Md Rakibul am 26 Feb. 2014
I have similar problem but not related to input/matrix size. One of my file works in my workplace MATLAB but does not work in my personal laptop. it gives "Error in port widths or dimensions. Output port 1 of 'ueki1/control+robot/robot/f1/Invm*(tau-C-g)' has 3 elements. This port does not accept the dimensions (or orientation) specified by the output signal." But I know there are no errors in dimensions. Previously I solved this problem by removing extra sign in summation block. Lets say you added 3 inputs in summation block. Then you decided to remove one input but kept the summation block as +++ instead of ++ which gives problem in dimension. It worked last time. But this time still been trying to look in the file for the same issue. But did not find anything like that. Any Idea please GUY or Kausthuba?

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by