Path: news.mathworks.com!not-for-mail
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$1@fred.mathworks.com>
References: <4b464a96-bf26-49fe-82ec-dd821145cb3e@z9g2000yqi.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1239257464 25439 172.30.248.38 (9 Apr 2009 06:11:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 9 Apr 2009 06:11:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:531589

mango <sniperhunters@gmail.com> wrote in message <4b464a96-bf26-49fe-82ec-dd821145cb3e@z9g2000yqi.googlegroups.com>...
> 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