I am trying to store two persistent variables in order to use them in further iterations. The problem is with the second variable 'weight'. It has a default value 0.1. Once I give a value to my function's 2nd argument, it should take this value.
The code is
function out =exp_average(in,b)
persistent average weight
weight = 0.1;
When I give two arguments to my function, it want my persistent variable 'weight' take the value of the input argument 'b'. With this code it does not keep its value. Any help will be appreciated.