Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Undefined function - min/max

Subject: Undefined function - min/max

From: susan

Date: 08 Apr, 2008 17:09:02

Message: 1 of 7

Hi! I keep getting an error while trying to run code with
this:

mindata=min(data);

The error is "Undefined function or variable "min"."

 The same error happens with max. Everything else in the
code works.I can run this from command line though!

Subject: Re: Undefined function - min/max

From: David

Date: 08 Apr, 2008 17:25:05

Message: 2 of 7

"susan " <suetibu@hotmail.com> wrote in message
<ftg8re$akl$1@fred.mathworks.com>...
> Hi! I keep getting an error while trying to run code
with
> this:
>
> mindata=min(data);
>
> The error is "Undefined function or variable "min"."
>
> The same error happens with max. Everything else in the
> code works.I can run this from command line though!

how about an example? sometimes you can find the problem
when trying to cut the code down to the shortest section
that reproduces the problem so you can post it, preferably
no more than a half dozen lines or so.

maybe put a 'which min' and 'whos min' just before the
error line. or use the debugger to stop on error and then
do the which and whos command to see what it thinks 'min'
really means at that point.


Subject: Re: Undefined function - min/max

From: Bill

Date: 08 Apr, 2008 17:42:05

Message: 3 of 7

when you were experimenting with code, you created a
variable named "min" and "max".

Now min and max don't live here anymore.

Restart Matlab and search your scripts for where you
assigned a value to min and max. Then change their names to
a non protected name. Even MIN and MAX will work.

I have the same problem with 'size' because stuff I analyze
has size as an object description.... !

Subject: Re: Undefined function - min/max

From: us

Date: 08 Apr, 2008 17:55:09

Message: 4 of 7

"Bill ":
<SNIP wrong track...

> when you were experimenting with code, you created a
> variable named "min" and "max".
> Now min and max don't live here anymore...

no, in this case the OP would have received a different
error -or- depending oh the type of <min>/<max>, no error
at all...

us

Subject: Re: Undefined function - min/max

From: susan

Date: 08 Apr, 2008 20:44:08

Message: 5 of 7

"us " <us@neurol.unizh.ch> wrote in message
<ftgbht$o9t$1@fred.mathworks.com>...
> "Bill ":
> <SNIP wrong track...
>
> > when you were experimenting with code, you created a
> > variable named "min" and "max".
> > Now min and max don't live here anymore...
>
> no, in this case the OP would have received a different
> error -or- depending oh the type of <min>/<max>, no
error
> at all...
>
> us

Hi! Yes I had assigned it earlier!! Thanks everybody.

Subject: Re: Undefined function - min/max

From: susan

Date: 08 Apr, 2008 20:48:04

Message: 6 of 7

"us " <us@neurol.unizh.ch> wrote in message
<ftgbht$o9t$1@fred.mathworks.com>...
> "Bill ":
> <SNIP wrong track...
>
> > when you were experimenting with code, you created a
> > variable named "min" and "max".
> > Now min and max don't live here anymore...
>
> no, in this case the OP would have received a different
> error -or- depending oh the type of <min>/<max>, no
error
> at all...
>
> us

Hi! Yes I had assigned it earlier!! Thanks everybody.

Subject: Re: Undefined function - min/max

From: susan

Date: 08 Apr, 2008 20:48:04

Message: 7 of 7

"us " <us@neurol.unizh.ch> wrote in message
<ftgbht$o9t$1@fred.mathworks.com>...
> "Bill ":
> <SNIP wrong track...
>
> > when you were experimenting with code, you created a
> > variable named "min" and "max".
> > Now min and max don't live here anymore...
>
> no, in this case the OP would have received a different
> error -or- depending oh the type of <min>/<max>, no
error
> at all...
>
> us

Hi! Yes I had assigned it earlier!! Thanks everybody.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
missing min and max functions Bill 08 Apr, 2008 13:45:13
function min max susan 08 Apr, 2008 13:10:15
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics