How would one go about trimming a matrix graphically?
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Richard Wanat
il 20 Mar 2017
Commentato: Richard Wanat
il 25 Mag 2017
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 Commenti
Risposta accettata
Renee Coetsee
il 23 Mar 2017
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.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Annotations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!