I have a fixed input and output for my simulink embeded function. However I would like to compute a variable size element inside the function, (only used for calculation).
Therefore I would prefer not to declare the block as receiving or sending dynamic size signal. (or using coder.varsize)
ex:
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]
Here the variable G is always fixed... but I have this type of error :
Dimension 2 is fixed on the left-hand side but varies on the right ([1 x 9] ~= [1 x :?])
Thank you for your time.