Error: When loading a matrix input, the blocks loading the corresponding data columns of the matrix must specify dimension using a scalar
5 次查看(过去 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.
- How to specify a matrix (2D!) with one scalar?
- 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.
0 个评论
回答(1 个)
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'))
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!