help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: max([],1)


From: John W. Eaton
Subject: Re: max([],1)
Date: Tue, 12 Jun 2007 18:17:51 -0400

On  8-Jun-2007, David Bateman wrote:

| Gerd Bürger wrote:
| > In octave-2.9 I get
| >
| > max(1,[]) = 1, max([],1) = [].
| >
| > Is that on purpose?
| >
| > Gerd
| > _______________________________________________
| > Help-octave mailing list
| > address@hidden
| > https://www.cae.wisc.edu/mailman/listinfo/help-octave
| >
| >   
| I get the same behavior in 2.9.12+, but MatlabR2007a gives..
| 
| >> max(1,[])
| 
| ans =
| 
|      []
| 
| >>  max([],1)
| 
| ans =
| 
|      []
| 
| >> max(1,[],1)
| 
| ans =
| 
|      1
| 
| In fact I think the matlab behavior is rather stupid as "max(1,[])"
| should probably be treated as "max(1,[],1)". In any case the attached
| patch makes the behavior compatible.. John, make your choice whether you
| want to apply it or not...

What does Matlab do with things like

  max (1, zeros (0, 10))
  max (1, zeros (10, 0))
  max (zeros (0, 10), 1)
  max (zeros (10, 0), 1)

etc.?  Are we also compatible with those behaviors?

Thanks,

jwe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]