Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
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 !
Solved! Go to Solution.
Use vectorization.
But as min can't be vectorized, we have to write our own min function, calling the built in min.
Use vectorization.
But as min can't be vectorized, we have to write our own min function, calling the built in min.
Short, simple and clear . Thank you very much
Is there any good reason why min (and max, and mean and stdev) can't be vectorized?
I think all the above answers for the xxx1, 2 and 3 functions are OK, so they could (should!) have been produced by vectorizing the original function immediately.
Luc
I, too, can't think of any good reason why min and max should not allow vectorization.
I see you've given that a thorough thought. 🙂
Luc