I am attempting to use upfirdn in a MATLAB function block, as in the following example, where x is a signal and h is an input from a constant block:
function y = useupfirdn(x, h)
y = upfirdn(x, h);
When I run the model, I get an error that says "The filter H must be constant." The same happens when it is used as a parameter.
I do not get the error when I build the filter using firls within the function block. However, the point of having it as an argument or a parameter is that I compute the coefficients prior to running the simulation, which would save time since the block is called often.
Is there something that I am missing?