我的 simulink 嵌入函数有一个固定的输入和输出。但是我想在函数内部计算一个可变大小的元素(仅用于计算)。
因此,我不希望将该块声明为接收或发送动态大小信号。(或使用 coder.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 :?])
感谢您的时间。