octave-maintainers
[Top][All Lists]
Advanced

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

Re: fix null assignment


From: Levente Torok
Subject: Re: fix null assignment
Date: Thu, 18 Sep 2008 14:23:48 +0200
User-agent: KMail/1.9.6 (enterprise 0.20070907.709405)

On Thursday 18 September 2008, Jaroslav Hajek wrote:

Hi all,

However, I think matlab compatibility is the top priority
I believe octave was much more consistent in terms of mat

> hello,
> 
> the attached patch fixes the following problems / Matlab
> incompatibilities with null assignment in Octave.
> 
> 2. a = 1:5; a(1:5) = []
> --> a is 0-by-0 in Octave, 1-by-0 in Matlab

> 3. a = 1:5; a = a'; a(1:5) = []
> --> a is 0-by-0 in Octave, 0-by-1 in Matlab


> 4. a = ones (3); a(:,:) = []
> --> a is 0-by-0 in Octave, 0-by-3 in Matlab

> 5. a = ones (3); a(1:3,1:3) = []
> --> a is 0-by-0 in Octave, error in Matlab

> 6. a = ones (3); a(1:2,1:2) = []
> --> a is unaffected in Octave (! BUG), error in Matlab

I don't believe it makes much sense to follow Matlab in these aspects
with the exception of the bug.

To make myself clear why I think so:

a = 1:5; a(1:5) = []; a * a'
is 0 in matlab and ans = [](0x0)

While the matlab version is handy when dealing with real data but faulty in 
terms of math.
I mean how can a scalar product equal to 0 when there are no items in the 
product.

May be we should open a bug ticket in matlab homepage:)

Levente

-- 
Blogger of http://fapuma.blogspot.com


reply via email to

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