help-octave
[Top][All Lists]
Advanced

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

Re: max([],1)


From: David Bateman
Subject: Re: max([],1)
Date: Wed, 13 Jun 2007 07:50:51 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

Tom Holroyd (NIH/NIMH) [E] wrote:
> Matlab 7.2 says,
> 
>>> max (1, zeros (0, 10))
> ans =
>    Empty matrix: 0-by-10
>>> max (1, zeros (10, 0))
> ans =
>    Empty matrix: 10-by-0
>>> max (zeros (0, 10), 1)
> ans =
>    Empty matrix: 0-by-10
>>> max (zeros (10, 0), 1)
> ans =
>    Empty matrix: 10-by-0
> 
> John W. Eaton wrote:
> 
>> 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)


And Octave without this patch does

octave:1>   max (1, zeros (0, 10))
ans =  1
octave:2>   max (1, zeros (10, 0))
ans =  1
octave:3>   max (zeros (0, 10), 1)
ans = [](0x10)
octave:4>   max (zeros (10, 0), 1)
ans = [](10x0)

and with it does

octave:1>   max (1, zeros (0, 10))
ans = [](0x10)
octave:2>   max (1, zeros (10, 0))
ans = [](10x0)
octave:3>   max (zeros (0, 10), 1)
ans = [](0x10)
octave:4>   max (zeros (10, 0), 1)
ans = [](10x0)

I think the patch is compatible, I just am not sure its the best thing
to do..

D.


reply via email to

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