我的simulink嵌入函数有固定的输入和输出。
但是,我想在函数中计算一个可变大小的元素(仅用于计算)。
因此,我不希望将块声明为接收或发送动态大小信号。(或使用编码器varsize)
例如:
K = find( p_var(:) == 0 ); % p_var is a vector containing some zeros
p_var(K) = []; % p_var is a therefore a varsize vector
% the variability is something I need for reason
n = length(p_var) % n is dynamic
M = ones(10,n) % M & L are also dynamic
L = ones(n,50)
G = M*L; % G is fixed of size [10*50]
这里变量G总是固定的。。。但我有这样的错误:
Dimension 2 is fixed on the left-hand side but varies on the right ([1 x 9] ~= [1 x :?])
感谢您抽出时间。