Selecting data from an imported table
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I uploaded a large excel spreadsheet on matlab using the import tool. The data has not been cleaned up and I need to be able to write a script that allows me to delete the remaining non useful data. I was thinking of using an if statement that will allow me to delete all the data when the difference between two consecutive values in the same column is larger that a certain value. For example, all my values are between 2000 and 3000, and suddenly, there is a large drop to 20. So I'm wanting to delete all columns and rows after that large drop.
0 comentarios
Respuestas (1)
dpb
el 27 de Sept. de 2019
Presuming the data array is variable array x and it's the first column to explore...
x=xlsread('yourfile.xls');
ix=find(diff(x:,1)<-1000); % look for a large drop; save that location
x=x([1:ix],:); % save only those locations
If this occurs in multiple columns and not necessarily the same row in each, then you can no longer keep the data in an ordanary double array; you would have to either convert locations from the offending location to NaN or other "bad data" indicator or use cell array to store each column.
0 comentarios
Ver también
Categorías
Más información sobre Tables en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!