I am using simulink user defined block to realise a difference equation. The function is defined as shown below.
function y = fcn(u)
a = [1 -2 1];
b = [0 1 2];
y=filter(b,a,u);
When I use this block independenly with some array as input, I am able to get the expected values. But when I use this block in another design, the output is always zero though the input is changing. Any suggestions on how to debug this ?
4 Comments
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/598381-simulink-user-defined-matlab-function-outputs-zero-irrespective-of-input#comment_1020682
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/598381-simulink-user-defined-matlab-function-outputs-zero-irrespective-of-input#comment_1020682
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/598381-simulink-user-defined-matlab-function-outputs-zero-irrespective-of-input#comment_1020760
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/598381-simulink-user-defined-matlab-function-outputs-zero-irrespective-of-input#comment_1020760
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/598381-simulink-user-defined-matlab-function-outputs-zero-irrespective-of-input#comment_1021129
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/598381-simulink-user-defined-matlab-function-outputs-zero-irrespective-of-input#comment_1021129
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/598381-simulink-user-defined-matlab-function-outputs-zero-irrespective-of-input#comment_1021702
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/598381-simulink-user-defined-matlab-function-outputs-zero-irrespective-of-input#comment_1021702
Sign in to comment.