suppress findpeaks warnings in MATLAB Signal Processing Toolbox
I use the function findpeaks from MATLAB's Signal Processing Toolbox. But everytime the function does not find any peaks I receive the warning:
Warning: No peaks found.
> In findpeaks at 83
Now I have to handle those cases anyway and therefore check if the vector returned by findpeaks
is empty. So I wo开发者_如何学Pythonuld like to suppress those warnings, because I don't want my Command Window to get cluttered up.
First identify the warning id:
findpeaks([1 1 1 1 ]);
[msg id] = lastwarn;
Then switch off the warning:
warning('off',id)
精彩评论