Extracting values from an array which correspond to values from another array
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Joshua Chambers
el 21 de Feb. de 2017
Comentada: Joshua Chambers
el 21 de Feb. de 2017
Hi
I have three equal-length arrays: x, y and c.
c ranges from 0 - 415, x from 0 - 1 and y from 0 - 1500.
I want to select the data from c which have values <50, and then select the corresponding data from the other two arrays.
I can find the required values for c, but cannot find how to select the data from the other arrays.
Any help would be appreciated!
Josh
0 comentarios
Respuesta aceptada
Stephen23
el 21 de Feb. de 2017
Read these:
And then check this out:
>> A = randi(9,1,9)
A =
4 7 7 4 5 4 7 3 1
>> B = rand(1,9)
B =
0.610330 0.959444 0.900687 0.967633 0.010723 0.783159 0.016694 0.609336 0.980585
>> idx = A<5;
>> A(idx)
ans =
4 4 4 3 1
>> B(idx)
ans =
0.61033 0.96763 0.78316 0.60934 0.98059
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical 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!