How to delete specific rows in this matrix?
Afficher commentaires plus anciens
So I have a set of data with which I converted into a matrix. In this matrix I have to delete rows who's average is less than 50. I run a for loop like this:
filename = '/home/kelm/uegabe/Alle/Muringayi/Tactile Sensor Robot Measurements/S1M1/2017-7-18_111304.txt';
m = importdata(filename);
m(:,1) = [];
for i = 1:size(m,1)
avg = mean(m(i,:));
if avg < 50
m(i,:) = [];
continue
end
end
However, all I get back is index exceeds matrix dimensions. I am also able to cut down on some of the rows who's average is less than fifty because the number of rows in my matrix goes from 717 to 426, but there are still more that remain. Does anyone know where I am going wrong and how I can delete the appropriate rows?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!