Why is my function working only when I call it directly in the plot?
I wrote a function which rounds the value of the signal after the first maximum is obtained. However, when I call this function and store the result and plot it, I do not see the expected result.