Look and extract numbers within a range in MATLAB
Mostrar comentarios más antiguos
Hi, i am still learning about matlab, so here is my question. I got two matrix dimension mx3 and nx3.
A=[2,2345,111; 2,2344,3000; 4, 2345,200 ; 4,2000,200; 2,2346,22; 4,2111,1; 4,3111,1]
B=[2,2345,112; 2,2344,3110; 4, 2345,192 ; 4,2000,184; 2,2346,22; 4,2111,456]
Lets say we are looking for 3rd column. A(:,3) are condition for B(:,3).What i want to do is to extract all rows that value from A column 3 is in range of value from B+-10%
Example:
Lets take first row from A: 2,2345,111 and B: 2,2345,112. Value 112 is within a range 10% deviation of 111, so we extract those rows in a new matrix. If we take second row we see that 3110 is bigger than 3000+-10%, so we dont extract that in new matrix.
I hope you understood my question. Thank you very much in advance.
Nice day, Nejc
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!