When doing

Plot[ArgMin[Norm[x - {-3, -1, 0, 5}, p], x], {p, 1, 3}]

I get this error message:

Plot::exclul: {(Abs[-5+x]^p+Abs[x]^p+Abs[1+x]^p+Abs[3+x]^p)-0,(3+x)-0,(1+x)-0,x-0,(-5+x)-0,
 must be a list of equalities or real-valued functions.

The plot itself seems to be OK

enter image description here

-- although I am not sure because of this error. What caused it?


This is a bug that seems to have been resolved in version 11.1, and is related to the exclusion detection functionality used by Mathematica to detect discontinuities. (The presence of Abs[] in the function being analyzed is what triggered the exclusion detection.)

Since you know that the function is continuous in your range of interest, just add Exclusions -> None:

Plot[ArgMin[Norm[x - {-3, -1, 0, 5}, p], x], {p, 1, 3}, 
     Exclusions -> None]

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.