How to delete specific values
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Filip Konecny
el 24 de Oct. de 2017
Respondida: KSSV
el 25 de Oct. de 2017
Hello to all,
I have a problem and I do not know what to do with it. Imagine I have column vector of time data: 3 5 7 9 11 13 13.1 15 15.1
and so on. I want to deduct the n+1 with n value and then to count the average. So it means average of (0.1 1.9 0.1 2 2 2 2 2). The problem is that the 0.1 and 0.1 are faulty numbers and I should not take them into account. Is there a way how to delete the faulty values in the Time vector?
1 comentario
Akira Agata
el 25 de Oct. de 2017
Question for clarification. Is your array differ from the following numeric array?
x = [0.1, 1.9, 0.1, 2, 2, 2, 2, 2];
if not, you can delete x = 0.1 elements by:
idx = x == 0.1;
x(idx) = [];
Respuesta aceptada
KSSV
el 25 de Oct. de 2017
x = [3 5 7 9 11 13 13.1 15 15.1];
dx = diff(x) ;
tol = 10^-3 ;
dx(abs(dx-0.1)<=tol) = []
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Whos 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!