1
$\begingroup$

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, p-0,Im[Abs[-5+x]^p+Abs[x]^p+Abs[1+x]^p+Abs[3+x]^p]-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?

$\endgroup$
7
  • 1
    $\begingroup$ What happens if you add Exclusions -> None? $\endgroup$ Commented Jan 5, 2019 at 4:53
  • $\begingroup$ @J.M.iscomputer-less Aha the error is gone then. The plot is the same. Could you explain this, in an answer? $\endgroup$ Commented Jan 5, 2019 at 4:54
  • $\begingroup$ Before anything else: what version and OS is this? $\endgroup$ Commented Jan 5, 2019 at 4:54
  • 1
    $\begingroup$ @J.M.iscomputer-less 11.0.1.0 on Windows 10 $\endgroup$ Commented Jan 5, 2019 at 4:55
  • 2
    $\begingroup$ I do not get an error message with v11.3 on a Mac. $\endgroup$ Commented Jan 5, 2019 at 4:59

1 Answer 1

2
$\begingroup$

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] 
$\endgroup$
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.