Error: When loading a matrix input, the blocks loading the corresponding data columns of the matrix must specify dimension using a scalar

3 次查看(过去 30 天)
I use MATLAB to create a variable weights. This variable is 11x216 in size.
I have a Simulink Inport, which expects an input matrix of 11x216.
I save the variable weights alongside other variables in a *.mat file.
Then, I use the Inport functionality of Simulink to import that *.mat file and use the Map Mode "Port Order" to input the data into my model.
However, I get the warning:
> When loading a matrix input, the blocks loading the corresponding data columns of the matrix must specify dimension using a scalar
This makes no sense to me.
  1. How to specify a matrix (2D!) with one scalar?
  2. Okay, they mean each data column. But how exactly do I specify the dimension of that data column? The inports do not provide such a functionality.
Can anyone help me here? I dont know what this error means. My variable type/dimensions match up with the input dimensions of that port.

回答(1 个)

Fangjun Jiang
Fangjun Jiang 2023-2-10
In R2022b, open this doc and see the example model.
To import 2D data, there is a specific format which should be the same regardless from .mat file or from workspace.
web(fullfile(docroot, 'simulink/slref/read-2d-signals-in-structure-format-from-workspace.html'))

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by