Is matrix multiplication with empty matrix in simulink impossible?

조회 수: 4 (최근 30일)
Twan Keijzer
Twan Keijzer 2020년 10월 22일
댓글: Twan Keijzer 2020년 10월 22일
I am trying to run a simulation in which (based on the settings) certain channels are unused. As I want to be able to change the settings without changing the simulink file, certain channels are still there but should carry an empty vector (size 0 by 1). However, in creating this empty vector using a gain block in matrix multiplication mode (0 by n gain matrix times n by 1 signal) the following error occurs: Invalid setting in '.../Gain' for parameter 'Gain'.
My main question is thus: Is it impossible to do a matrix multiplication which results in an empty matrix in simulink?
Furthermore, I would also like to know whether there are alternatives to using a gain, that do allow you to get an empty vector on a simulink channel.
One alternative I have tried is to move this matrix multiplication into an enabled subsystem such that it is only executed when the result is not empty. However, the error still occurs. A minimal example of this is attached.
  댓글 수: 2
dpb
dpb 2020년 10월 22일
I don't have and have never even seen a Simulink installation, but I can certainly imagine operations on null element aren't allowed.
Would seem to me from what I know of Simulink that you would simply set the outputs of the given channels to 0, not try to make them disappear.
Twan Keijzer
Twan Keijzer 2020년 10월 22일
Thank you for the response. But setting the output to 0 does not allow to solve the problem I am having. Furthermore, operations on null elements are allowed in Matlab. Therefore, I don't find it logical that it is not possible in Simulink.
In the problem I am dealing with setting the output to 0 does not work. I have a vector, that I need to split up in two parts, and the size of the parts depends on the settings. The limit case of these settings corresponds to one of the parts being size 0 by 1. Then operations are performed on both parts, and they are added back together.
If I set the output to 0, instead of making it size 0 by 1, an extra 0 will be added to the final recomposed vector. This vector will then be 1 element too long for further calculations.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by