Get the common lowest values of 2 datasets?

I have 2 datasets,
a = [ 6.7082 5.3852 3.0000 4.1231 3.1623 7.0711 4.0000 1.0000 1.0000 5.0990 4.4721];
b = [70.0000 75.0000 49.0000 9.0000 65.0000 79.0000 6.0000 51.0000 56.0000 9.0000 71.0000];
If I was to get the smallest value of each set, how do I get the optimal smallest common value for both sets. eg smallest value of "a" is 1.0000 and smallest value of b is 6.0000, however the corresponding value at the 1.0000 (at same index) is 51.00000 and for 6.0000 you have 4.0000. Maybe this isn't possible to do so but I was wondering can you?

5 comentarios

Joachim Schlosser
Joachim Schlosser el 10 de Nov. de 2015
Sounds like a maths homework exercise, doesn't it?
Ronan
Ronan el 10 de Nov. de 2015
It isn't homework. I m not sure if I m missing something obvious or if its too abstract to answer. I thought about getting the max and min of both and comparing there percentage but doesn't seem ideal.
Stephen23
Stephen23 el 10 de Nov. de 2015
Editada: Stephen23 el 10 de Nov. de 2015
The arrays a and b do not seem to share any values at all, so how can they have a "common minimum value"? What do you mean by "common value", if this is not the usual meaning of a value that is common to both vectors?
Adam Barber
Adam Barber el 10 de Nov. de 2015
If I understand correctly, you really just want the smallest total column? If so, can't you just add a and b and take the minimum?
Ronan
Ronan el 11 de Nov. de 2015
I probably worded it wrongly in saying common value. Because the two datasets are not related the question is out of context. I was trying to relate them so that you could choose which row has the idealistic lowest value. Adding them and taking the minimum is probably the best I can do. It was more of a thought experiment than anything.

Iniciar sesión para comentar.

Respuestas (1)

Thorsten
Thorsten el 10 de Nov. de 2015
Editada: Thorsten el 10 de Nov. de 2015
[~, idx] = min(a);
min1 = [a(idx) b(idx)]
[~, idx] = min(b);
min2 = [a(idx) b(idx)]

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 10 de Nov. de 2015

Comentada:

el 11 de Nov. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by