Error: The external inputs specified for the block diagram indicate that the port dimensions should be [MxN]. Instead, the port dimensions are being set to [?].

31 views (last 30 days)
I use a MATLAB script to create a variable compVals. This variable has the dimensions 1x11.
I have a Simulink Inport that expects a variable/input with the dimensions 11 (Port dimensions value set to "11").
I want to load this data via *.mat file into the port (I use Map Mode "Port Order"), however, I get the error:
> Error: The external inputs specified for the block diagram indicate that the port dimensions should be [10x1]. Instead, the port dimensions are being set to [11].
Okay, so I get it, the dimensions of the port may be set to [1, 11]. However, if I do that, I get the error:
> Parameter mismatch (no additional information)
  • If I let it stay like that, why does it reduce to 10x1, although it should be 1x11?
  • Is the first row in the column(s) the size/length of the column vector?
Can anyone help me please?

Answers (1)

Fangjun Jiang
Fangjun Jiang on 10 Feb 2023
If your variable size is 1x11 and you import it to Simulink as it is, then the data is interprated as
First column is time vactor and the rest of the columns are data.
So you are actually importing 10 signals, but there is only one set of data for each signal. For example, data [1, 2, 3, 4] means importing three signals. At time=1second, Signal A's value is 2, signal B's value is 3, signal C's value is 4.
This is probably not what you intended.
Click Help button at the "From Workspae" block to see the document for data format and examples.

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!