How to use logic between two points with only a negavite slope?
2 次查看(过去 30 天)
显示 更早的评论
I have a vector that starts at ~84 decreases to ~77 and then increases to ~84 again. I am only interested in the negative slope of this vector! For example, in the image below, I am only interested in the x points between ~2100 and ~9500 as that is the decreasing slope. Using my logic selects both the negative and positive slope. I am sure there are better ways to do this. Any help would be appreciated.
wndwSize = 30;
h = ones(1,wndwSize)/wndwSize;
G = filter(h, 1,file.data.X.signals.values>78.1) & filter(h, 1,file.data.X.signals.values<82.9);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/166590/image.jpeg)
2 个评论
Jan
2017-8-8
What is shown in the diagram? Where do the values 78.1 and 82.9 come from? What does "interested in the negative slope of this vector" exactly mean? What do you need as output?
采纳的回答
Jan
2017-8-8
"Negative slope" sounds like:
index = (gradient(file.data.X.signals.values) < 0);
Or do you mean:
v = filter(h, 1,file.data.X.signals.values);
index = (v > 78.1) & (v < 82.9);
I'm not sure about the meaning of the question.
5 个评论
Image Analyst
2017-8-9
Noise is not signal. So how does filtering out noise -- that is, removing noise to get the true signal -- make the data less precise??? The noise made the data less precise (not the filtering), so by not filtering and keeping the noise, that's what will make it less precise. I've never heard anyone say that keeping noise mixed in with their signal made it more precise than the signal alone.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!