0

I have written a S-Function in MATLAB. Now I want to pass a Matrix into the input via the 'simin' Source. I have initialized the time of the simin variable with simin.time = 0 and the values are stored in a dynamically sized matrix. So for example simin.signals.values = ones(4). Now MATLAB tells me that 'time and data values must have the same number of rows'. I understand that but how can I pass a matrix in one timestep? And is it possible to simulate a S-Function only once and not cyclic?

4

1 回答 1

1

您需要指定信号的尺寸,请参阅文档

Matlab 文档

我做了一个简单的测试,模拟了 10 秒,一切看起来都不错。

simin.time = 0;
simin.signals.values = ones(4)
simin.signals.dimensions = [4,4];

简单模型

于 2015-02-05T22:43:06.093 回答