Error: When loading a matrix input, the blocks loading the corresponding data columns of the matrix must specify dimension using a scalar
조회 수: 2 (최근 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!