Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Error in port widths or dimensions

Subject: Error in port widths or dimensions

From: Mihai Gherman

Date: 17 Feb, 2005 03:24:38

Message: 1 of 1

Hello,

I am trying to upgrade some models and S-function (Level1 to Level2
S-function
upgrade) for Matlab 7.0.1(R14) and I
can't figure out why I'm still getting this error messages:

Error using ==> RTW.makertw.make_rtw
Error using ==> tlc_c
Error using ==> rtwgen
--> Error in port widths or dimensions. Invalid dimension has
been specified
for input port 3 of 'pv_ges3/3/Switch_1'.
--> Error in port widths or dimensions. Invalid dimension has
been specified for output port 1 of 'pv_ges3/3/Mux_5'.

This models have worked fine under Matlab 6 and now it seems to be a
problem with the port dimensioning. It seems to be a problem related
with this (-1) that I use, for inherited.
The Signal Specification of the MUX,DMUX and Switches inputs have
the Port dimension and sample time set to -1, (inherited).

On another model I have almost the same problem, there I get the
fallowing
error message:
Error using ==> RTW.makertw.make_rtw
Error using ==> tlc_c
Error using ==> rtwgen
--> Invalid setting for input port dimensions of
'x/.../x/x/Demux_2'. 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 'x/.../x/x/in_5'.

This "in_5" block has also the port dimension and sample time
set to -1 (inherited)Everything else in the Signal Specification is
set on Auto.
I am not even sure if this has anything to do with my S-functions
because after the first errors I have sized the input ports
dynamically according to matlab help. Now I am stuck here, I don't
even know if the problem is caused by my function or just a
environment variable. I've also tried to override the data
type to "true doubles" in the Fixed-Point Settings in Simulink.
Maybe is just a trivial situation, maybe not but I am out of ideas.

Has anyone encountered something like this before? Any advice is
important.

Thank you

Mihai

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us