From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Get a strange error while use 'min' function for 'sym'
Date: Thu, 9 Apr 2009 06:11:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 23
Message-ID: <grk3ho$oqv$>
References: <>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1239257464 25439 (9 Apr 2009 06:11:04 GMT)
NNTP-Posting-Date: Thu, 9 Apr 2009 06:11:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:531589

mango <> wrote in message <>...
> Hi, All.
>   I've got a problem like this:
>       input some insturctions like
>                 syms x y
>                 min(x,y)
>    in the workspace.Then get the following error :
> ??? Function 'min' is not defined for values of class 'sym'.
> Error in ==> min at 34
>   builtin('min', varargin{:});
> In the other side, I try to use abs function like this,
>                 syms x
>                 abs(x)
> Then get the correct answer.How to solve this probelm?
> pls help me ,thank you in advance.

  Think about it, Mango.  What answer can you expect out of min(x,y) when x and y are merely symbols whose values cannot be compared numerically.  Matlab could answer: "Duh! Ya got me!" but I don't think users would like that very much.  Much better to respond with an error indication.

Roger Stafford