Skip to main content
1-Visitor
Oct 15, 2016 1:29 PM UTC
Solved

How to create a vector with the minimum values of two other vectors?

If I have a vector A and B both with 10 elements. How can i create a vector  C that has the minimum values of A or B on each corresponding position.

Thanks in advance !

Werner_E
Werner_EAnswer
25-Diamond I
Oct 17, 2016 6:42 AM UTC

Use vectorization.

But as min can't be vectorized, we have to write our own min function, calling the built in min.

5 replies

Werner_E
Werner_E25-Diamond IAnswer
25-Diamond I
Oct 17, 2016 6:42 AM UTC

Use vectorization.

But as min can't be vectorized, we have to write our own min function, calling the built in min.

Translate
1-Visitor
Oct 17, 2016 10:09 PM UTC

Short, simple and clear . Thank you very much

Translate