How would one go about trimming a matrix graphically?
4 次查看(过去 30 天)
显示 更早的评论
I have multiple large datasets (doesn't everyone) that I need to figure out a quicker way of "trimming" before post processing. I need to keep the original dataset unaltered, but each of these datasets has a variable that was changed multiple times during the recording. Each dataset has the first column being time and then another twenty or so columns of sensor data. For each of these datasets, I would like to quickly plot a single column of data versus time, select a timeframe of data that has reached steady state and then save the "trimmed" dataset as a new matrix.
0 个评论
采纳的回答
Renee Coetsee
2017-3-23
You could accomplish this using the 'KeyPressFcn' figure callback:
When you click on the figure, you can plot a vertical line at that location. The x value of that line (which can be accessed from the line's properties) will correspond to the last (or first) value that you would like in the data matrix. You could use a button, which when pressed, will 1) duplicate the matrix, as to not modify the original 2) find the first occurrence x-value in the matrix 3) delete all elements after that x-value.
I hope these steps will help! Depending on your data, the first occurrence of an x-value may be before you want to trim. In this case, you can try finding the approximate index of the line using the line's position relative to the length of the axes.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!