Error: Simulink Scope Block does not support 'Array' format for logging matrix signals
조회 수: 41 (최근 30일)
이전 댓글 표시
I'm looking to log data from Simulink to the workspace as an array. I have two outputs as seen in the attached image, one is a 4x1 matrix and the other is a 2x1. I've reviewed the requirements for logging data as an array and I can't figure out what needs to change in my setup. The array outputs are 4 x 1 x t and 2 x 1 x t, where t is the size of the simulation time array. I want it to be a 2D array for each output, size 4 x t and 2 x t.
Currently I initialize each array using:
x_d = zeros(4,1);
u_d = zeros(2,1);
And then calculate the value of each element before sending the matrix on as the output signal.
I know one workaround would be just to send each individual element on as vectors and connecting each output to scope blocks. Or I think I could add in a block to change the dimensions of each signal.
Both ways seem inefficient so I'm sure there's another way in the initial setup I'm missing for the variable matrices.
Appreciate any help!
댓글 수: 0
채택된 답변
Paul
2023년 3월 18일
편집: Paul
2023년 3월 18일
If haven't done already this doc page is a good place to start to compare all options. In my experience, scopes are useful for looking at time traces, but not that useful for logging data for post-sim analysis. Of course, your mileage may vary.
댓글 수: 2
Paul
2023년 3월 19일
If the input to the To Workspace is [4x1], you can insert a Signal Specification block onto the signal going in to the To Workspace. Set the 'Dimensions' parameter to 4 (or a variable that you know defines the long dimension of the signal). The To Workspace block will save the signal with 4 columns.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Sources에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!