Borrar filtros
Borrar filtros

how to select the required value from among all values

1 visualización (últimos 30 días)
jaah navi
jaah navi el 14 de Abr. de 2019
Comentada: madhan ravi el 14 de Abr. de 2019
If I am having the data as
1 2 3
4 5 9
6 6 12
6 3 9
10 11 21
.
.
.
4 6 10
where the first and second number add to give the third number for all the combinations
if i need to choose the addition of two values that gives the result 9 ,and suppose there are two possibilities how to choose any one of the possibility.
could anyone please help me on this.
  3 comentarios
Walter Roberson
Walter Roberson el 14 de Abr. de 2019
I do not see how factor() could be useful in this question??
madhan ravi
madhan ravi el 14 de Abr. de 2019
Ah I misunderstood the question.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 14 de Abr. de 2019
row9 = find(YourData(:,3) == 9);
one_of_them = row9( randi(length(row9)) );

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by