Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
Why can we not vectorize the built-in min() or max() function? Is it a bug or a feature?
Would be convenient in some situations to be able to do so without creating a dummy function like below:
Found a statement by Tom Gutman here http://communities.ptc.com/message/59886#59886:
"max and min are defined to work on arrays, so they do not vectorize."
As I understand it, the vectorization is kind of an implicit loop over the elements of the argument vectors of a funbtion before it is called. If thats true, it should work with min and max, too. An then, my dummy function f() would work with scalars and vectors alike, as does min() and vectorization works with it. Built-in operators like multiplication accept vector and scalars alike and can be veoctorized.
So whats the problem with min/max? Should it considered a bug or just a missing feature?