I'm using Matlab Coder to convert this code to C++:
fs = 50;
[b,a] = butter(3,0.5/(fs/2),'high');
...
% Other code using fs
Then, I get this error: "All inputs must be constant".
If I do: [b,a] = butter(3,0.5/(50/2),'high');
, it works.
I found this post: Constants and Matlab Coder
So I tried:
fs = 50;
[b,a] = coder.const(@butter,3,0.5/(fs/2),'high');
But it still reports the same error. How can I fix this?