I am assuming the code you posted lives only in the mask initialization of your block. In that case the variable 'x' and 'y' go out of scope after the block initialization is performed. You can ensure that the variables 'x' and 'y' are put in the base workspace by using the evalin or assignin command inside the mask. Alternatively, you can set the numerator/denominator to their respective numeric value by performing the following command:
set_param([gcb '/filter_1'],'Numerator', ['[' num2str(x) ']'], 'Denominator', ['[' num2str(y) ']'])
Best Answer